lib.records.view_service

Module Contents

Classes

LegendEntryRecord(self,symbol,legend_text,type_code,type_code_list,theme,sub_theme=None,other_theme=None) Represents a legend entry with it’s text as well as it’s image.
ViewServiceRecord(self,reference_wms,legend_at_web=None,legends=None) A view service contains a valid WMS URL with a defined set of layers.
class LegendEntryRecord(symbol, legend_text, type_code, type_code_list, theme, sub_theme=None, other_theme=None)

Represents a legend entry with it’s text as well as it’s image.

Args:

symbol (pyramid_oereb.lib.records.image.ImageRecord): The binary content of the legend symbol. legend_text (dict of unicode): The multilingual description text for the legend entry. type_code (unicode): The class of the legend entry corresponding to the plrs classes. type_code_list (unicode): An URL to the type code list. theme (pyramid_oereb.lib.records.theme.ThemeRecord): The theme to which the legend entry belongs

to.

sub_theme (unicode): Theme sub category. other_theme (unicode): Additional theme linked to this theme.

__init__(symbol, legend_text, type_code, type_code_list, theme, sub_theme=None, other_theme=None)
class ViewServiceRecord(reference_wms, legend_at_web=None, legends=None)

A view service contains a valid WMS URL with a defined set of layers.

Attributes:
image (pyramid_oereb.lib.records.image.ImageRecord or None): Binary image content downloaded from WMS
link.
__init__(reference_wms, legend_at_web=None, legends=None)

Args: reference_wms (uri): The link URL to the actual service (WMS) legend_at_web (uri): The link URL to the actual legend service (WMS get legend) legends (list of LegendEntry): A list of all relevant legend entries.

get_map_size()
get_bbox(map_size, print_buffer)
get_full_wms_url(real_estate, format)

Returns the WMS URL to get the image.

Args:
real_estate (pyramid_oereb.lob.records.real_estate.RealEstateRecord): The Real
Estate record.
format (string): The format currently used. For ‘pdf’ format,
the used map size will be adapted to the pdf format,
Returns:
str: The url used to query the WMS server.
download_wms_content()

Simply downloads the image found behind the URL stored in the instance attribute “reference_wms”.

Raises:
LookupError: Raised if the response is not code 200 AttributeError: Raised if the URL itself isn’t valid at all.
unique_update_legends(legend)
Uniquely append a legend to the legend entries. It checks if a legend entry with the same type code
already exists in the legends of this instance.
Args:
legend (pyramid_oereb.lib.records.view_service.LegendEntryRecord): The legend entry which
should be append to the list.