views.webservice

Module Contents

Classes

PlrWebservice(self,request) This class provides the PLR webservice methods.
Parameter(self,flavour,format,geometry,images,identdn=None,number=None,egrid=None,language=None,topics=None)
Logo(self,request) Webservice to deliver logo images.
Municipality(self,request) Webservice to deliver municipality images.
Symbol(self,request) Webservice to deliver legend entry images.
Sld(self,request) Webservice to deliver a valid sld content to filter a av base layer to only one dedicated real estate.
class PlrWebservice(request)

This class provides the PLR webservice methods.

Args:
request (pyramid.request.Request or pyramid.testing.DummyRequest): The pyramid request instance.
__init__(request)
_is_json()

Returns True if the requests format is JSON.

Returns:
bool: True if requested format is JSON.
get_versions()

Returns the available versions of this service.

Returns:
pyramid.response.Response: The versions response.
get_capabilities()

Returns the capabilities of this service.

Returns:
pyramid.response.Response: The capabilities response.
get_egrid_coord()

Returns a list with the matched EGRIDs for the given coordinates.

Returns:
pyramid.response.Response: The getegrid response.
get_egrid_ident()

Returns a list with the matched EGRIDs for the given NBIdent and property number.

Returns:
pyramid.response.Response: The getegrid response.
get_egrid_address()

Returns a list with the matched EGRIDs for the given postal address.

Returns:
pyramid.response.Response: The getegrid response.
get_extract_by_id()

Returns the extract in the specified format and flavour.

Returns:
pyramid.response.Response: The extract response.
__validate_extract_params__()

Validates the input parameters for get_extract_by_id.

Returns:
pyramid_oereb.views.webservice.Parameter: The validated parameters.
__coord_transform__(coord, source_crs)

Transforms the specified coordinates from the specified CRS to the configured target CRS and creates a point geometry.

Args:
coord (tuple): The coordinates to transform (x, y). source_crs (intorstr): The source CRS
Returns:
shapely.geometry.Point or shapely.geometry.Polygon: The transformed coordinates as Point.
__get_egrid_response__(records)

Creates a valid GetEGRID response from a list of real estate records.

Args:
records (list of pyramid_oereb.lib.records.real_estate.RealEstateRecord): List of real
estate records.
Returns:
pyramid.response.Response: The getegrid response.
__parse_xy__(xy, buffer_dist=None)

Parses the coordinates from the XY parameter, transforms them to target CRS and creates a point geometry. If a buffer distance is defined, a buffer with the specified distance will be applied.

Args:

xy (str): XY parameter from the getegrid request. buffer_dist (float or None): Distance for the buffer applied to the transformed

point.If None, no buffer will be applied.
Returns:
shapely.geometry.Point or shapely.geometry.Polygon: The transformed coordinates as Point.
__parse_gnss__(gnss)

Parses the coordinates from the GNSS parameter, transforms them to target CRS and creates a Point with a 1 meter buffer.

Args:
gnss (str): GNSS parameter from the getegrid request.
Returns:
shapely.geometry.Point or shapely.geometry.Polygon: The transformed coordinates as Point.
class Parameter(flavour, format, geometry, images, identdn=None, number=None, egrid=None, language=None, topics=None)
__init__(flavour, format, geometry, images, identdn=None, number=None, egrid=None, language=None, topics=None)

Creates a new parameter instance.

Args:
flavour (str): The extract flavour. format (str): The extract format. geometry (bool): Extract with/without geometry. images (bool): Extract with/without images. identdn (str): The IdentDN as real estate identifier. number (str): The parcel number as real estate identifier. egrid (str): The EGRID as real estate identifier. language (str): The requested language. topics (list of str): The list of requested topics.
set_identdn(identdn)

Updates the IdentDN.

Args:
identdn (str): The IdentDN as real estate identifier.
set_number(number)

Updates the parcel number.

Args:
number (str): The parcel number as real estate identifier.
set_egrid(egrid)

Updates the EGRID.

Args:
egrid (str): The EGRID as real estate identifier.
set_language(language)

Updates the language.

Args:
language (str): The requested language.
set_topics(topics)

Updates the requested topics.

Args:
topics (list of str): The list of requested topics.
flavour()

Returns: str: The requested flavour.

format()

Returns: str: The requested format.

geometry()

Returns: bool: Extract requested with geometries.

images()

Returns: bool: Extract requested with images.

identdn()

Returns: str: The requested IdentDN.

number()

Returns: str: The requested number.

egrid()

Returns: str: The requested EGRID.

language()

Returns: str: The requested language.

topics()

Returns: list of str: The requested topics.

skip_topic(theme_code)

Check if the topic should be skipped in extract.

Args:
theme_code (str): The PLR theme code.
Returns:
bool: True if the topic should be skipped.

Webservice to deliver logo images.

Args:
request (pyramid.request.Request or pyramid.testing.DummyRequest): The pyramid request instance.
__init__(request)
get_image()

Returns a response containing the binary image content using the configured “get_logo_method”.

Returns:
pyramid.response.Response: Response containing the binary image content.
class Municipality(request)

Webservice to deliver municipality images.

Args:
request (pyramid.request.Request or pyramid.testing.DummyRequest): The pyramid request instance.
__init__(request)
get_image()

Returns a response containing the binary image content using the configured “get_municipality_method”.

Returns:
pyramid.response.Response: Response containing the binary image content.
class Symbol(request)

Webservice to deliver legend entry images.

Args:
request (pyramid.request.Request or pyramid.testing.DummyRequest): The pyramid request instance.
__init__(request)
get_image()

Returns a response containing the binary image content using the configured “get_symbol_method”.

Returns:
pyramid.response.Response: Response containing the binary image content.
class Sld(request)

Webservice to deliver a valid sld content to filter a av base layer to only one dedicated real estate.

__init__(request)

Args: request (pyramid.request.Request or pyramid.testing.DummyRequest): The pyramid request instance.

get_sld()

Webservice which delivers an SLD file from parameter input. However this is a proxy pass through only. We use it to call the real method configured in the dedicated yaml file and hope that this method is accepting a pyramid.request.Request as input and is returning a pyramid.response.Response which encapsulates a well designed SLD.

Note

The config path to define this hook method is: pyramid_oereb.real_estate.visualisation.method

Returns:
pyramid.response.Response: The response provided by the hooked method provided by the
configuration
Raises:
pyramid.httpexceptions.HTTPInternalServerError: When the return value of the hooked method was not
of type pyramid.response.Response

pyramid.httpexceptions.HTTPNotFound: When the configured method was not found.