lib.processor

Module Contents

Classes

Processor(self,real_estate_reader,municipality_reader,exclusion_of_liability_reader,glossary_reader,plr_sources,extract_reader)
class Processor(real_estate_reader, municipality_reader, exclusion_of_liability_reader, glossary_reader, plr_sources, extract_reader)
__init__(real_estate_reader, municipality_reader, exclusion_of_liability_reader, glossary_reader, plr_sources, extract_reader)

The Processor class is directly bound to the get_extract_by_id service in this application. It’s task is to unsnarl the difficult model of the oereb extract and handle all objects inside this extract correctly. In addition it provides an easy to use method interface to access the information. It is also used to wrap all accessors in one point to have a processing interface.

Args:
real_estate_reader (pyramid_oereb.lib.readers.real_estate.RealEstateReader): The
real estate reader instance for runtime use.
municipality_reader (pyramid_oereb.lib.readers.municipality.MunicipalityReader): The
municipality reader instance for runtime use.
exclusion_of_liability_reader
(pyramid_oereb.lib.readers.exclusion_of_liability.ExclusionOfLiabilityReader): The exclusion of liability reader instance for runtime use.
glossary_reader (pyramid_oereb.lib.readers.glossary.GlossaryReader): The glossary
reader instance for runtime use.
plr_sources (list of pyramid_oereb.standard.sources.plr.DatabaseSource): The
public law restriction source instances for runtime use wrapped in a list.
extract_reader (pyramid_oereb.lib.readers.extract.ExtractReader): The extract reader
instance for runtime use.
filter_published_documents(record)

Filter only published documents.

Args:
record (pyramid_oereb.lib.records.plr.PlrRecord or
pyramid_oereb.lib.records.documents.DocumentRecord): The public law restriction or document record.
plr_tolerance_check(extract)

The function checking if the found plr results exceed the minimal surface or length value defined in the configuration and should therefor be represented in the extract or considered ‘false trues’ and be removed from the results.

Args:
extract (pyramid_oereb.lib.records.extract.ExtractRecord): The extract in it’s
unvalidated form
Returns:
pyramid_oereb.lib.records.extract.ExtractRecord: Returns the updated extract
view_service_handling(images, format)
Handles all view service related stuff. In the moment this is:
  • construction of the correct url (reference_wms) depending on the real estate
  • downloading of the image if parameter was set
Args:
real_estate (pyramid_oereb.lib.records.real_estate.RealEstateRecord):
The real estate record to be updated.

images (bool): Switch whether the images should be downloaded or not. format (string): The format currently used. For ‘pdf’ format,

the used map size will be adapted to the pdf format,
Returns:
pyramid_oereb.lib.records.real_estate.RealEstateRecord: The updated extract.
get_legend_entries(outside_plrs)

We need to apply the right legend entries to each plr record which is intersecting the real estate. This means to make a topic wise grouping and find every legend entry which is on one hand not the same type code as the intersecting plr itself and on the other hand the same type code as the non intersecting one. We finally need to attach all this criteria matching legend entries to the intersecting one.

Args:
inside_plrs (list of pyramid_oereb.lib.records.plr.PlrRecord): The PLR’s which are intersecting
the real estate
outside_plrs (list of pyramid_oereb.lib.records.plr.PlrRecord): The PLR’s which are in the BBOX
of the view but not intersecting the real estate
Returns:
list of pyramid_oereb.lib.records.plr.PlrRecord: The updated records with the hopefully correct
legend entries assigned.
real_estate_reader()

Returns: pyramid_oereb.lib.readers.real_estate.RealEstateReader: The real estate reader instance.

municipality_reader()

Returns: pyramid_oereb.lib.readers.municipality.MunicipalityReader: The municipality reader reader instance.

exclusion_of_liability_reader()

Returns: pyramid_oereb.lib.readers.exclusion_of_liability.ExclusionOfLiabilityReader: The exclusion of liability reader reader instance.

glossary_reader()

Returns: pyramid_oereb.lib.readers.glossary.GlossaryReader: The glossary reader reader instance.

plr_sources()

Returns: list of pyramid_oereb.lib.sources.plr.DatabaseSource: The list of plr source instances.

extract_reader()

Returns: pyramid_oereb.lib.readers.extract.ExtractReader: The extract reader instance.

process(real_estate, params, sld_url)

Central processing method to hook in from webservice.

Args:
real_estate (pyramid_oereb.lib.records.real_estate.RealEstateRecord): The real
estate reader to obtain the real estates record.
params (pyramid_oereb.views.webservice.Parameter): The parameters of the extract
request.
sld_url (str): The URL which provides the sld to style and filter the highlight of the real
estate.
Returns:
pyramid_oereb.lib.records.extract.ExtractRecord: The generated extract record.