Skip to content

Commit

Permalink
Merge pull request #29 from mrmap-community/fix/bbox_lat_lon_prop
Browse files Browse the repository at this point in the history
Fix/bbox lat lon prop
  • Loading branch information
jokiefer authored Feb 21, 2024
2 parents 4dab59a + dd3ce5a commit 2c46f66
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[v0.14.0] - 2024-02-21
---------------------

Fixed
~~~~~

[v0.12.7] - 2023-12-15
* added missing `bbox_lat_lon` value inside `transform_to_model` of Layer mapper



[v0.13.0] - 2023-12-15
---------------------

Added
Expand Down
2 changes: 1 addition & 1 deletion ows_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.13.0"
__version__ = "0.14.0"
VERSION = __version__ # synonym
6 changes: 6 additions & 0 deletions ows_lib/xml_mapper/capabilities/wms/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@ def descendants(self, include_self=True):
descendants.extend(child.descendants)
return descendants

def transform_to_model(self) -> Dict:
attr = super().transform_to_model()
if self.bbox_lat_lon:
attr.update({"bbox_lat_lon": self.bbox_lat_lon})
return attr


class WebMapServiceMixin(OGCServiceMixin):
"""Abstract class for WebMapService xml mappers,
Expand Down
24 changes: 24 additions & 0 deletions tests/xml_mapper/capabilities/wms/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,30 @@ def _test_layer_mapper(self):
"https://registry.gdi-de.org/id/de.bund.dwd/de.dwd.geoserver.fach.RBSN_FF"
)

self.assertDictEqual(
self.parsed_capabilities.root_layer.transform_to_model(),
{
"abstract": "This is the Web Map Server of DWD.",
"bbox_lat_lon": Polygon(
(
(-180, -90),
(-180, 90),
(180, 90),
(180, -90),
(-180, -90)
)
),
"identifier": "root_layer",
"is_cascaded": True,
"is_opaque": True,
"is_queryable": True,
"scale_max": 8.7308025,
"scale_min": 4.989528903,
"title": "DWD GeoServer WMS"
}

)

def test_wms_xml_mapper(self):
self._test_root_mapper()
self._test_service_metadata_mapper()
Expand Down
4 changes: 2 additions & 2 deletions tests/xml_mapper/capabilities/wms/test_1_3_0.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os

from django.test import SimpleTestCase

from ows_lib.xml_mapper.capabilities.wms.wms130 import WebMapService
from ows_lib.xml_mapper.namespaces import WMS_1_3_0_NAMESPACE, XLINK_NAMESPACE
from tests.xml_mapper.capabilities.wms.mixins import \
WebMapServiceTestCase
from tests.settings import DJANGO_TEST_ROOT_DIR
from tests.xml_mapper.capabilities.wms.mixins import WebMapServiceTestCase


class WebMapService130TestCase(WebMapServiceTestCase, SimpleTestCase):
Expand Down

0 comments on commit 2c46f66

Please sign in to comment.