Compare commits

..

1 Commits

Author SHA1 Message Date
mpeltriaux d39e758df4 # Quickfix
* fixes bug for better API response on geometry invalidities
2026-07-16 15:42:29 +02:00
3 changed files with 12 additions and 0 deletions
+2
View File
@@ -156,6 +156,8 @@ class AbstractModelAPISerializer:
if isinstance(geojson, dict):
geojson = json.dumps(geojson)
geometry = geos.fromstr(geojson)
if not geometry.valid:
raise ValueError(f"Invalid geometry: {geometry.valid_reason}")
is_4326 = Geometry.is_valid_4326(geometry)
if not is_4326:
raise ValueError("Geometry not in EPSG:4326 (WGS84). Unknown spatial reference system.")
+5
View File
@@ -0,0 +1,5 @@
"""
Author: Michel Peltriaux
Created on: 16.07.26
"""
+5
View File
@@ -0,0 +1,5 @@
"""
Author: Michel Peltriaux
Created on: 16.07.26
"""