From e97ef2cec9bacf631f7ac0844a12f893f1254c52 Mon Sep 17 00:00:00 2001 From: sujanadh Date: Mon, 22 Jan 2024 09:31:50 +0545 Subject: [PATCH] fix divide by square on multipolygon geojson --- src/backend/app/projects/project_crud.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index cf75818962..973f0aa5a0 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -515,10 +515,12 @@ def remove_z_dimension(coord): # Merge multiple geometries into single polygon if multi_polygons: - boundary = multi_polygons[0] + geometry = multi_polygons[0] for geom in multi_polygons[1:]: - boundary = boundary.union(geom) - + geometry = geometry.union(geom) + for feature in features: + feature["geometry"] = geometry + boundary["features"] = features return await run_in_threadpool( lambda: split_by_square( boundary,