worldbank / GOSTnets

Convenience wrapper for networkx analysis using geospatial information, focusing on OSM
https://worldbank.github.io/GOSTnets/
MIT License
21 stars 15 forks source link

osmids gone for nodes when using edges_and_nodes_csv_to_graph function #26

Closed ccsuehara closed 3 years ago

ccsuehara commented 3 years ago

Hi gostnets team,

I was wondering how I could get back the osmids for the nodes when I use the (1) edges_and_nodes_csv_to_graph function. When I run the gn.node_gdf_from_graph function to the graph created with (1), instead of having the osmid as node_ID, the index only seem to appear. Thanks!

d3netxer commented 3 years ago

yes @ccsuehara gn.edges_and_nodes_gdf_to_graph currently gets rid of the original node IDs and issues new ones in an incremental function. I recently pushed code in a new branch (https://github.com/worldbank/GOSTnets/tree/advanced_snapping) that modifies the function so that it preserves the original node IDs. Hopefully we will get it merged into master soon.

ccsuehara commented 3 years ago

Thanks, I'll close the issue, best.