#243 Feature without geometry

* fixes GDALException in case of provided feature (import) without geometry content
* modifies 500.html template to inform the user about the admins being informed automatically
This commit is contained in:
2022-11-22 14:49:51 +01:00
parent cf874225c1
commit 870d822c3a
4 changed files with 9 additions and 4 deletions

View File

@@ -82,7 +82,12 @@ class SimpleGeomForm(BaseForm):
"MultiPolygon25D",
]
for feature in features_json:
feature_geom = json.dumps(feature.get("geometry", feature))
feature_geom = feature.get("geometry", feature)
if feature_geom is None:
# Fallback for rare cases where a feature does not contain any geometry
continue
feature_geom = json.dumps(feature_geom)
g = gdal.OGRGeometry(feature_geom, srs=DEFAULT_SRID_RLP)
flatten_geometry = g.coord_dim > 2