Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read feature type BBOX from GET response #51

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions geoservercloud/models/featuretype.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def from_get_response_payload(cls, content: dict):
projection_policy=feature_type["projectionPolicy"],
service_configuration=feature_type["serviceConfiguration"],
advertised=feature_type.get("advertised"),
native_bounding_box=feature_type.get("nativeBoundingBox"),
lat_lon_bounding_box=feature_type.get("latLonBoundingBox"),
encode_measures=feature_type.get("encodeMeasures"),
forced_decimals=feature_type.get("forcedDecimals"),
simple_conversion_enabled=feature_type.get("simpleConversionEnabled"),
Expand Down
32 changes: 30 additions & 2 deletions tests/models/test_featuretype.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,21 @@ def test_featuretype_from_get_response_payload():
"enabled": True,
"advertised": True,
"projectionPolicy": "FORCE_DECLARED",
"srs": "EPSG:4326",
"srs": "EPSG:2056",
"nativeBoundingBox": {
"minx": 2485014.052451379,
"maxx": 2837016.9329778464,
"miny": 1074188.6943776933,
"maxy": 1299782.763494124,
"crs": {"@class": "projected", "$": "EPSG:2056"},
},
"latLonBoundingBox": {
"minx": 5.902662003204146,
"maxx": 10.603307860867739,
"miny": 45.7779277267225,
"maxy": 47.8485348773655,
"crs": "EPSG:4326",
},
"title": "Test Title",
"abstract": "Test Abstract",
"keywords": {"string": ["keyword1", "keyword2"]},
Expand Down Expand Up @@ -176,7 +190,21 @@ def test_featuretype_from_get_response_payload():
assert feature_type.native_name == "test_native_name"
assert feature_type.store_name == "test_store"
assert feature_type.workspace_name == "test_workspace"
assert feature_type.srs == "EPSG:4326"
assert feature_type.srs == "EPSG:2056"
assert feature_type.native_bounding_box == {
"minx": 2485014.052451379,
"maxx": 2837016.9329778464,
"miny": 1074188.6943776933,
"maxy": 1299782.763494124,
"crs": {"@class": "projected", "$": "EPSG:2056"},
}
assert feature_type.lat_lon_bounding_box == {
"minx": 5.902662003204146,
"maxx": 10.603307860867739,
"miny": 45.7779277267225,
"maxy": 47.8485348773655,
"crs": "EPSG:4326",
}
assert feature_type.title.asdict()["title"] == "Test Title"
assert feature_type.abstract.asdict()["abstract"] == "Test Abstract"
assert feature_type.keywords == ["keyword1", "keyword2"]
Expand Down