Example #1
0
 def set_highlight_url(self, sld_url):
     configured_params = Config.get_real_estate_config().get(
         'visualisation').get('url_params')
     additional_url_params = {}
     for param in configured_params:
         additional_url_params.update({param: getattr(self, param)})
     updated_sld_url = add_url_params(sld_url, additional_url_params)
     self.highlight = ViewServiceRecord(
         add_url_params(self.plan_for_land_register.reference_wms,
                        {'sld': updated_sld_url}), '')
     self.highlight.download_wms_content()
    def get_full_wms_url(self, 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.
        """

        assert real_estate.limit is not None

        map_size = self.get_map_size(format)
        bbox = self.get_bbox(real_estate.limit)
        self.reference_wms = add_url_params(
            self.reference_wms, {
                "BBOX": ",".join([str(e) for e in bbox]),
                "SRS": 'EPSG:{0}'.format(Config.get('srid')),
                "WIDTH": int(map_size[0]),
                "HEIGHT": int(map_size[1])
            })
        self.calculate_ns()
        return self.reference_wms
Example #3
0
    def set_highlight_url(self, sld_url):
        """
        Set the highlight of the real estate.

        Args:
            sld_url (str): The URL which provides the sld to style and filter the highlight of the real
            estate.
        """
        configured_params = Config.get_real_estate_config().get(
            'visualisation').get('url_params')
        additional_url_params = {}
        for param in configured_params:
            additional_url_params.update({param: getattr(self, param)})
        updated_sld_url = add_url_params(sld_url, additional_url_params)
        self.highlight = ViewServiceRecord(
            add_url_params(self.plan_for_land_register.reference_wms,
                           {'sld': updated_sld_url}),
            self.plan_for_land_register.layer_index,
            self.plan_for_land_register.layer_opacity,
            legend_at_web={})
        self.highlight.download_wms_content()