fix: polygons уже содержит polygon.coordinates — MultiPolygon.coordinates = polygons

This commit is contained in:
2026-09-09 14:28:30 +03:00
parent 10f00e2d2e
commit 5464ce370a
+2 -2
View File
@@ -177,10 +177,10 @@ def _water_geoms(elements: list[dict]) -> list[dict]:
if len(polygons) == 1:
geom = polygons[0] # {'type': 'Polygon', 'coordinates': [ring]}
else:
# GeoJSON MultiPolygon: собираем полигоны в один Multi.
# GeoJSON MultiPolygon: coordinates = список polygon.coordinates.
geom = {
'type': 'MultiPolygon',
'coordinates': [p['coordinates'] for p in polygons],
'coordinates': polygons,
}
out.append({'layer': layer, 'name': name, 'geom': geom,
'area_m2': sum(areas),