12 lines
385 B
Python
12 lines
385 B
Python
|
from shapely import MultiPolygon, Polygon
|
||
|
|
||
|
|
||
|
def convert_outage_geometry(event) -> MultiPolygon:
|
||
|
assert event["polygons"]["type"] == "polygon"
|
||
|
assert event["polygons"]["hasZ"] is False
|
||
|
assert event["polygons"]["hasM"] is False
|
||
|
polygon_list = []
|
||
|
for ring in event["polygons"]["rings"]:
|
||
|
polygon_list.append(Polygon(ring))
|
||
|
return MultiPolygon(polygon_list)
|