次のようにpythonを使用すると、次のことが起こりosmnx
ます。
graph = osmnx.graph_from_polygon(Data.bbox)
gdf_nodes, gdf_edges = osmnx.save_load.graph_to_gdfs(
graph,
nodes=True, edges=True,
node_geometry=True,
fill_edge_geometry=True)
print(gdf_edges['u']) # prints the values nicely
graph2 = osmnx.save_load.gdfs_to_graph(gdf_nodes, gdf_edges) # misses 'v' and 'u' column in gdf_nodes
次に、次のエラーが表示されます。
File "C:\Users\jpelda\AppData\Local\Continuum\anaconda3\lib\site-packages\osmnx\save_load.py", line 513, in gdfs_to_graph
G.add_edge(u=row['u'], v=row['v'], key=row['key'], **attrs)
TypeError: add_edge() missing 2 required positional arguments: 'u_for_edge' and 'v_for_edge'