Normalize area geometries to two dimensions
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user