Update scripts/build_bus_regions.py
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
This commit is contained in:
parent
d5db3b8d80
commit
aa867cb704
@ -107,15 +107,6 @@ def voronoi_partition_pts(points, outline, no_multipolygons=False):
|
||||
|
||||
polygons.append(poly)
|
||||
|
||||
if no_multipolygons:
|
||||
def demultipolygon(poly):
|
||||
try:
|
||||
# for a MultiPolygon pick the part with the largest area
|
||||
poly = max(poly.geoms, key=lambda pg: pg.area)
|
||||
except:
|
||||
pass
|
||||
return poly
|
||||
polygons = [demultipolygon(poly) for poly in polygons]
|
||||
|
||||
return np.array(polygons, dtype=object)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user