* adds special error message treatment for non-EPSG:4326 geometries
This commit is contained in:
2026-07-10 19:01:24 +02:00
parent f5aaac2acf
commit 22a92cb3df
2 changed files with 23 additions and 0 deletions
+3
View File
@@ -156,6 +156,9 @@ class AbstractModelAPISerializer:
if isinstance(geojson, dict):
geojson = json.dumps(geojson)
geometry = geos.fromstr(geojson)
is_4326 = Geometry.is_valid_4326(geometry)
if not is_4326:
raise ValueError("Geometry not in EPSG:4326 (WGS84). Unknown spatial reference system.")
geometry = Geometry.cast_to_rlp_srid(geometry)
geometry = Geometry.cast_to_multipolygon(geometry)
return geometry