Normalize area geometries to two dimensions
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 02:01:11 +02:00
parent ec3e7a4fa8
commit 3f7b90f009
4 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -3,13 +3,14 @@ from __future__ import annotations
from typing import Any
from pyproj import Transformer
from shapely import force_2d
from shapely.geometry import GeometryCollection, MultiPolygon, Polygon, box, shape
from shapely.ops import transform
from shapely.validation import make_valid
def normalize_to_multipolygon(raw_geometry: dict[str, Any]) -> MultiPolygon:
geom = shape(raw_geometry)
geom = force_2d(shape(raw_geometry))
if geom.is_empty:
raise ValueError("Geometry is empty")