From 33f45175a9c0ce8b68ca5563be515f8698c26717 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 25 Jun 2024 16:46:58 +0200 Subject: [PATCH 01/10] Add option to not verify certificate when calling the real estate WMS (useful for example if the WMS has a self-signed certificate) --- dev/config/pyramid_oereb.yml.mako | 2 ++ pyramid_oereb/core/records/view_service.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/config/pyramid_oereb.yml.mako b/dev/config/pyramid_oereb.yml.mako index 812b8598ad..97bd82e4ea 100644 --- a/dev/config/pyramid_oereb.yml.mako +++ b/dev/config/pyramid_oereb.yml.mako @@ -238,6 +238,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + verify_certificate: True plan_for_land_register_main_page: # WMS URL to query the plan for land register specially for static extracts overview page reference_wms: @@ -245,6 +246,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + verify_certificate: True visualisation: method: pyramid_oereb.core.hook_methods.produce_sld_content # Note: these parameters must fit to the attributes provided by the RealEstateRecord!!!! diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index cd88cad012..11e9d7cf64 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -80,7 +80,7 @@ class ViewServiceRecord(object): """ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, - srid, proxies=None, legends=None): + srid, proxies=None, legends=None, verify_certificate=True): """ Args: @@ -105,6 +105,7 @@ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, self.default_language = default_language self.srid = srid self.proxies = proxies + self.verify_certificate = verify_certificate if legends is None: self.legends = [] @@ -247,7 +248,7 @@ def download_wms_content(self, language): if uri_validator(wms): log.debug(f"Downloading image, url: {wms}") try: - response = requests.get(wms, proxies=self.proxies) + response = requests.get(wms, proxies=self.proxies, verify=self.verify_certificate) except Exception as ex: dedicated_msg = f"An image could not be downloaded. URL was: {wms}, error was {ex}" log.error(dedicated_msg) From e03bd8425179209da919703caead2f837c0a8265 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Mon, 1 Jul 2024 11:15:33 +0200 Subject: [PATCH 02/10] Add new configuration option --- pyramid_oereb/contrib/data_sources/standard/sources/plr.py | 1 + pyramid_oereb/core/readers/real_estate.py | 6 ++++-- pyramid_oereb/core/records/view_service.py | 4 ++-- tests/core/records/test_view_service.py | 5 ++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py index 729c2c882c..6993e55ee7 100644 --- a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py +++ b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py @@ -162,6 +162,7 @@ def from_db_to_view_service_record(self, view_service_from_db, legend_entry_reco Config.get('default_language'), Config.get('srid'), Config.get('proxies'), + Config.get('verify_certificate'), legends=legend_entry_records ) return view_service_record diff --git a/pyramid_oereb/core/readers/real_estate.py b/pyramid_oereb/core/readers/real_estate.py index b5ec3d98bd..e09a188f3e 100644 --- a/pyramid_oereb/core/readers/real_estate.py +++ b/pyramid_oereb/core/readers/real_estate.py @@ -63,7 +63,8 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): plan_for_land_register_config.get('layer_opacity'), Config.get('default_language'), Config.get('srid'), - Config.get('proxies') + Config.get('proxies'), + Config.get('verify_certificate') ) plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config() @@ -73,7 +74,8 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): plan_for_land_register_main_page_config.get('layer_opacity'), Config.get('default_language'), Config.get('srid'), - Config.get('proxies') + Config.get('proxies'), + Config.get('verify_certificate') ) self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry) diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index 11e9d7cf64..7b60099167 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -80,7 +80,7 @@ class ViewServiceRecord(object): """ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, - srid, proxies=None, legends=None, verify_certificate=True): + srid, proxies=None, verify_certificate=True, legends=None): """ Args: @@ -248,7 +248,7 @@ def download_wms_content(self, language): if uri_validator(wms): log.debug(f"Downloading image, url: {wms}") try: - response = requests.get(wms, proxies=self.proxies, verify=self.verify_certificate) + response = requests.get(wms, proxies=self.proxies) except Exception as ex: dedicated_msg = f"An image could not be downloaded. URL was: {wms}, error was {ex}" log.error(dedicated_msg) diff --git a/tests/core/records/test_view_service.py b/tests/core/records/test_view_service.py index fb9f1ee968..67d1eb7422 100644 --- a/tests/core/records/test_view_service.py +++ b/tests/core/records/test_view_service.py @@ -20,7 +20,8 @@ def test_init(): 'de', 2056, None, - None + True, + None, ) assert isinstance(record.reference_wms, dict) assert isinstance(record.layer_index, int) @@ -29,6 +30,7 @@ def test_init(): assert record.default_language == 'de' assert record.srid == 2056 assert record.proxies is None + assert record.verify_certificate is True assert len(record.legends) == 0 @@ -49,6 +51,7 @@ def test_init_with_relation(pyramid_oereb_test_config): 'de', 2056, None, + True, legend_records ) assert isinstance(record.reference_wms, dict) From 56810961a66298e4f014421338fa95b7cee1f38f Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Mon, 1 Jul 2024 11:25:46 +0200 Subject: [PATCH 03/10] Add new configuration option --- pyramid_oereb/core/records/view_service.py | 2 +- tests/core/records/test_view_service.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index 7b60099167..b082405c91 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -248,7 +248,7 @@ def download_wms_content(self, language): if uri_validator(wms): log.debug(f"Downloading image, url: {wms}") try: - response = requests.get(wms, proxies=self.proxies) + response = requests.get(wms, proxies=self.proxies, verify=self.verify_certicate) except Exception as ex: dedicated_msg = f"An image could not be downloaded. URL was: {wms}, error was {ex}" log.error(dedicated_msg) diff --git a/tests/core/records/test_view_service.py b/tests/core/records/test_view_service.py index 67d1eb7422..86ef81cb14 100644 --- a/tests/core/records/test_view_service.py +++ b/tests/core/records/test_view_service.py @@ -66,20 +66,20 @@ def test_init_with_relation(pyramid_oereb_test_config): def test_invalid_layer_index_arguments(pyramid_oereb_test_config): with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, -1001, 1, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, -1001, 1, 'de', 2056, None, True, None) with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1001, 1, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, 1001, 1, 'de', 2056, None, True, None) with pytest.warns(UserWarning, match='Type of "layer_index" should be "int"'): - ViewServiceRecord({'de': 'http://example.com'}, 1.0, 1, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, 1.0, 1, 'de', 2056, None, True, None) def test_invalid_layer_layer_opacity(pyramid_oereb_test_config): with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1, 2.0, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, 2.0, 'de', 2056, None, True, None) with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1, -1.1, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, -1.1, 'de', 2056, None, True, None) with pytest.warns(UserWarning, match='Type of "layer_opacity" should be "float"'): - ViewServiceRecord({'de': 'http://example.com'}, 1, 1, 'de', 2056, None, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, 1, 'de', 2056, None, True, None) def test_check_min_max_attributes(): From 99bb4548346a01b4580e32f0de3cdd4c0c51dc00 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Mon, 1 Jul 2024 13:00:07 +0200 Subject: [PATCH 04/10] Fix typo --- pyramid_oereb/core/records/view_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index b082405c91..92960d72b4 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -248,7 +248,7 @@ def download_wms_content(self, language): if uri_validator(wms): log.debug(f"Downloading image, url: {wms}") try: - response = requests.get(wms, proxies=self.proxies, verify=self.verify_certicate) + response = requests.get(wms, proxies=self.proxies, verify=self.verify_certificate) except Exception as ex: dedicated_msg = f"An image could not be downloaded. URL was: {wms}, error was {ex}" log.error(dedicated_msg) From 9bcfd61302e4065a1731b20ff4c0e7c4454c7a8a Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 9 Jul 2024 07:41:44 +0200 Subject: [PATCH 05/10] Review feedback --- .../data_sources/standard/models/__init__.py | 6 ++++-- .../data_sources/standard/sources/plr.py | 4 ++-- pyramid_oereb/core/readers/real_estate.py | 4 ++-- pyramid_oereb/core/records/view_service.py | 6 +++--- tests/core/records/test_view_service.py | 20 +++++++++---------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py index ea8d2b6c93..2d5c73ed15 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py @@ -16,7 +16,7 @@ from sqlalchemy import Column, ForeignKey -from sqlalchemy import String, Integer, Float, Date +from sqlalchemy import String, Integer, Float, Date, Boolean from geoalchemy2.types import Geometry as GeoAlchemyGeometry from sqlalchemy.orm import relationship from sqlalchemy_utils import JSONType @@ -174,7 +174,8 @@ class ViewService(base): reference_wms (dict of str): The actual url which leads to the desired cartographic representation (multilingual). layer_index (int): Index for sorting the layering of the view services for a theme - layer_opacity (float): Opacity of a view service + layer_opacity (float): Opacity of a view servicA + verify_certificate (boolean): Whether the certificate of the WMS shall be verified """ __table_args__ = {'schema': schema_name} __tablename__ = 'view_service' @@ -182,6 +183,7 @@ class ViewService(base): reference_wms = Column(JSONType, nullable=False) layer_index = Column(Integer, nullable=False) layer_opacity = Column(Float, nullable=False) + verify_certificate = Column(Boolean, nullable=True) return ViewService diff --git a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py index 6993e55ee7..2a83af43c9 100644 --- a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py +++ b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py @@ -162,8 +162,8 @@ def from_db_to_view_service_record(self, view_service_from_db, legend_entry_reco Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - Config.get('verify_certificate'), - legends=legend_entry_records + legends=legend_entry_records, + verify_certificate=view_service_from_db.verify_certificate ) return view_service_record diff --git a/pyramid_oereb/core/readers/real_estate.py b/pyramid_oereb/core/readers/real_estate.py index e09a188f3e..99c49d6912 100644 --- a/pyramid_oereb/core/readers/real_estate.py +++ b/pyramid_oereb/core/readers/real_estate.py @@ -64,7 +64,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - Config.get('verify_certificate') + plan_for_land_register_config.get('verify_certificate') ) plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config() @@ -75,7 +75,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - Config.get('verify_certificate') + plan_for_land_register_main_page_config.get('verify_certificate') ) self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry) diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index 92960d72b4..6893a997f1 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -80,7 +80,7 @@ class ViewServiceRecord(object): """ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, - srid, proxies=None, verify_certificate=True, legends=None): + srid, proxies=None, legends=None, verify_certificate=True): """ Args: @@ -91,6 +91,7 @@ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, srid (int): The SRID which is used for the WMS. proxies (dict or None): The proxies which may be used legends (list of LegendEntry or None): A list of all relevant legend entries. + verify_certificate (bool): indicates whether call to the WMS shall be verified """ self.reference_wms = reference_wms self.image = dict() # multilingual dict with binary map images resulting from calling the wms link @@ -105,14 +106,13 @@ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, self.default_language = default_language self.srid = srid self.proxies = proxies - self.verify_certificate = verify_certificate - if legends is None: self.legends = [] else: for legend in legends: assert isinstance(legend.symbol, ImageRecord) self.legends = legends + self.verify_certificate = verify_certificate @staticmethod def sanitize_layer_index(layer_index): diff --git a/tests/core/records/test_view_service.py b/tests/core/records/test_view_service.py index 86ef81cb14..529ffbb836 100644 --- a/tests/core/records/test_view_service.py +++ b/tests/core/records/test_view_service.py @@ -20,8 +20,8 @@ def test_init(): 'de', 2056, None, - True, None, + True ) assert isinstance(record.reference_wms, dict) assert isinstance(record.layer_index, int) @@ -30,8 +30,8 @@ def test_init(): assert record.default_language == 'de' assert record.srid == 2056 assert record.proxies is None - assert record.verify_certificate is True assert len(record.legends) == 0 + assert record.verify_certificate is True def test_init_with_relation(pyramid_oereb_test_config): @@ -51,8 +51,8 @@ def test_init_with_relation(pyramid_oereb_test_config): 'de', 2056, None, - True, - legend_records + legend_records, + True ) assert isinstance(record.reference_wms, dict) assert isinstance(record.layer_index, int) @@ -66,20 +66,20 @@ def test_init_with_relation(pyramid_oereb_test_config): def test_invalid_layer_index_arguments(pyramid_oereb_test_config): with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, -1001, 1, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, -1001, 1, 'de', 2056, None, None, True) with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1001, 1, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, 1001, 1, 'de', 2056, None, None, True) with pytest.warns(UserWarning, match='Type of "layer_index" should be "int"'): - ViewServiceRecord({'de': 'http://example.com'}, 1.0, 1, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, 1.0, 1, 'de', 2056, None, None, True) def test_invalid_layer_layer_opacity(pyramid_oereb_test_config): with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1, 2.0, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, 2.0, 'de', 2056, None, None, True) with pytest.raises(AttributeError): - ViewServiceRecord({'de': 'http://example.com'}, 1, -1.1, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, -1.1, 'de', 2056, None, None, True) with pytest.warns(UserWarning, match='Type of "layer_opacity" should be "float"'): - ViewServiceRecord({'de': 'http://example.com'}, 1, 1, 'de', 2056, None, True, None) + ViewServiceRecord({'de': 'http://example.com'}, 1, 1, 'de', 2056, None, None, True) def test_check_min_max_attributes(): From bced4b5578021e11b260f4754afef237b1f4ca1b Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 9 Jul 2024 15:17:44 +0200 Subject: [PATCH 06/10] Consider case when legends not explicitly passed as argument --- pyramid_oereb/core/readers/real_estate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid_oereb/core/readers/real_estate.py b/pyramid_oereb/core/readers/real_estate.py index 99c49d6912..6b708ee12a 100644 --- a/pyramid_oereb/core/readers/real_estate.py +++ b/pyramid_oereb/core/readers/real_estate.py @@ -64,7 +64,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - plan_for_land_register_config.get('verify_certificate') + verify_certificate=plan_for_land_register_config.get('verify_certificate') ) plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config() @@ -75,7 +75,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - plan_for_land_register_main_page_config.get('verify_certificate') + verify_certificate=plan_for_land_register_main_page_config.get('verify_certificate') ) self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry) From 62c466ff119a85d5c60b97b371d1a151f558becc Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 13 Aug 2024 10:10:05 +0200 Subject: [PATCH 07/10] Address review comments --- dev/config/pyramid_oereb.yml.mako | 1 + pyramid_oereb/contrib/data_sources/standard/models/__init__.py | 2 -- pyramid_oereb/contrib/data_sources/standard/sources/plr.py | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/config/pyramid_oereb.yml.mako b/dev/config/pyramid_oereb.yml.mako index 97bd82e4ea..32884f2094 100644 --- a/dev/config/pyramid_oereb.yml.mako +++ b/dev/config/pyramid_oereb.yml.mako @@ -246,6 +246,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + # Option to check certificate for external WMS. Default and recommended setting: True verify_certificate: True visualisation: method: pyramid_oereb.core.hook_methods.produce_sld_content diff --git a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py index 2d5c73ed15..a88aada246 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py @@ -175,7 +175,6 @@ class ViewService(base): representation (multilingual). layer_index (int): Index for sorting the layering of the view services for a theme layer_opacity (float): Opacity of a view servicA - verify_certificate (boolean): Whether the certificate of the WMS shall be verified """ __table_args__ = {'schema': schema_name} __tablename__ = 'view_service' @@ -183,7 +182,6 @@ class ViewService(base): reference_wms = Column(JSONType, nullable=False) layer_index = Column(Integer, nullable=False) layer_opacity = Column(Float, nullable=False) - verify_certificate = Column(Boolean, nullable=True) return ViewService diff --git a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py index 2a83af43c9..2f085cd489 100644 --- a/pyramid_oereb/contrib/data_sources/standard/sources/plr.py +++ b/pyramid_oereb/contrib/data_sources/standard/sources/plr.py @@ -163,7 +163,8 @@ def from_db_to_view_service_record(self, view_service_from_db, legend_entry_reco Config.get('srid'), Config.get('proxies'), legends=legend_entry_records, - verify_certificate=view_service_from_db.verify_certificate + # Note: our standard database model does not contain an option to override the verify_certificate + verify_certificate=True ) return view_service_record From d85c3e97544d47c8c2c9f65d8c5f0206c9b0c210 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Tue, 13 Aug 2024 10:12:51 +0200 Subject: [PATCH 08/10] Address lint issue --- pyramid_oereb/contrib/data_sources/standard/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py index a88aada246..f4459d729f 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py @@ -16,7 +16,7 @@ from sqlalchemy import Column, ForeignKey -from sqlalchemy import String, Integer, Float, Date, Boolean +from sqlalchemy import String, Integer, Float, Date from geoalchemy2.types import Geometry as GeoAlchemyGeometry from sqlalchemy.orm import relationship from sqlalchemy_utils import JSONType From b150d16adf96a44d88c70f8636f0351f32c1f9e0 Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Fri, 16 Aug 2024 09:59:20 +0200 Subject: [PATCH 09/10] Review comments --- .../contrib/data_sources/standard/models/__init__.py | 2 +- pyramid_oereb/core/readers/real_estate.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py index f4459d729f..ea8d2b6c93 100644 --- a/pyramid_oereb/contrib/data_sources/standard/models/__init__.py +++ b/pyramid_oereb/contrib/data_sources/standard/models/__init__.py @@ -174,7 +174,7 @@ class ViewService(base): reference_wms (dict of str): The actual url which leads to the desired cartographic representation (multilingual). layer_index (int): Index for sorting the layering of the view services for a theme - layer_opacity (float): Opacity of a view servicA + layer_opacity (float): Opacity of a view service """ __table_args__ = {'schema': schema_name} __tablename__ = 'view_service' diff --git a/pyramid_oereb/core/readers/real_estate.py b/pyramid_oereb/core/readers/real_estate.py index 6b708ee12a..e37d956446 100644 --- a/pyramid_oereb/core/readers/real_estate.py +++ b/pyramid_oereb/core/readers/real_estate.py @@ -64,7 +64,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - verify_certificate=plan_for_land_register_config.get('verify_certificate') + verify_certificate=plan_for_land_register_config.get('verify_certificate', True) ) plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config() @@ -75,7 +75,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None): Config.get('default_language'), Config.get('srid'), Config.get('proxies'), - verify_certificate=plan_for_land_register_main_page_config.get('verify_certificate') + verify_certificate=plan_for_land_register_main_page_config.get('verify_certificate', True) ) self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry) From fab63e26d69eb9a76a530595df91a37becf8f50a Mon Sep 17 00:00:00 2001 From: Wolfgang Kaltz Date: Fri, 16 Aug 2024 10:02:01 +0200 Subject: [PATCH 10/10] Review comment --- dev/config/pyramid_oereb.yml.mako | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/config/pyramid_oereb.yml.mako b/dev/config/pyramid_oereb.yml.mako index 32884f2094..94c1228c16 100644 --- a/dev/config/pyramid_oereb.yml.mako +++ b/dev/config/pyramid_oereb.yml.mako @@ -238,6 +238,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + # Option to check certificate for external WMS. Default and recommended setting: True verify_certificate: True plan_for_land_register_main_page: # WMS URL to query the plan for land register specially for static extracts overview page