parent
8b54a4b78c
commit
4accc75c06
4 changed files with 54 additions and 20 deletions
11
geospatial.py
Normal file
11
geospatial.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue