Skip to content

Issue when importing a network instead of using it within the function #209

Description

@csebastiao

Describe the bug
Sometimes when using the main growbikenet function, I receive a KeyError when importing a street network, even if it is the same as the one used in the function. This is not systematically the case, sometimes it works and sometimes it doesn't, with no obvious pattern.

To Reproduce
If I do:

edges_ranked = gbn.growbikenet(
"Asti",
ranking="betweenness_centrality",
export_data=False,
)

It works, but if instead I do:

file_out = "gdf_osm.gpkg"
city_boundary_gdf = ox.geocoder.geocode_to_gdf("Asti")
city_boundary_geometry = city_boundary_gdf.geometry[0]
G = ox.graph_from_polygon(city_boundary_geometry, network_type="drive")
ox.io.save_graph_geopackage(G, file_out)
edges_ranked = gbn.growbikenet(
"Asti",
ranking="betweenness_centrality",
export_data=False,
import_files={"street_network": file_out},
)

I receive a KeyError.

Expected behavior
I should not receive the KeyError when I import the street network.

Desktop (please complete the following information):

  • OS: MacOS Version 15.7.7

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions