fix: GeoJSON MultiPolygon — кольца оборачивать в полигоны ([[ring]])

Баг: для relation с 2+ внешними кольцами coordinates отдавался [ring0, ring1]
(глубина 3) при type=MultiPolygon — невалидный GeoJSON, Leaflet падал
('latlngs[0] undefined') → белый экран страницы анализа на кейсах с
мультиполигонами (РАС-кейс Минск: Камсамольскае возера из 2 колец).
Фронт: toLatLngs различает Polygon/MultiPolygon по глубине coords[0][0][0].
This commit is contained in:
2026-09-09 14:14:44 +03:00
parent 32af8975f9
commit 0320cad063
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -173,7 +173,8 @@ def _water_geoms(elements: list[dict]) -> list[dict]:
if not polygons:
continue
geom = (
{'type': 'MultiPolygon', 'coordinates': polygons}
# GeoJSON MultiPolygon: [[ring0], [ring1]] — каждый полигон = список колец.
{'type': 'MultiPolygon', 'coordinates': [[p] for p in polygons]}
if len(polygons) > 1 else
{'type': 'Polygon', 'coordinates': polygons[0]}
)