Skip to content

Commit

Permalink
Merge pull request #1125 from hotosm/fix-square-split
Browse files Browse the repository at this point in the history
Fix divide by square on multipolygon geojson
  • Loading branch information
nrjadkry authored Jan 22, 2024
2 parents c74855e + e97ef2c commit 6b32142
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6b32142

Please sign in to comment.