From b494bee65e2b1ce30e914eec70f832b4ff3c253a Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Thu, 23 Feb 2023 14:56:49 +0100 Subject: [PATCH] # Bugfix * fixes bug where multipolygon behaved in mapclient as single polygon, making e.g. deleting of single polygons impossible without removing everything --- konova/models/geometry.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/konova/models/geometry.py b/konova/models/geometry.py index f5fa839b..870b7c60 100644 --- a/konova/models/geometry.py +++ b/konova/models/geometry.py @@ -318,7 +318,7 @@ class Geometry(BaseResource): geom = self.geom if geom.srid != srid: geom.transform(ct=srid) - + polygons = [p for p in geom] geojson = { "type": "FeatureCollection", "crs": { @@ -330,8 +330,9 @@ class Geometry(BaseResource): "features": [ { "type": "Feature", - "geometry": json.loads(geom.json), + "geometry": json.loads(p.json), } + for p in polygons ] } return geojson