base_network: bugfix - bring voronoi cells in correct order

This commit is contained in:
Fabian Neumann 2024-08-04 16:01:51 +02:00 committed by GitHub
parent 7a16dd2aa4
commit ddf0da2687
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -808,7 +808,7 @@ def voronoi(points, outline, crs=4326):
voronoi = gpd.GeoDataFrame(geometry=voronoi)
joined = gpd.sjoin_nearest(pts, voronoi, how="right")
return joined.dissolve(by="Bus").squeeze()
return joined.dissolve(by="Bus").reindex(points.index).squeeze()
def build_bus_shapes(n, country_shapes, offshore_shapes, countries):