Closed curiosity654 closed 4 years ago
I figured it out, just use the props param. Thank you for this library!
Hi! Can you perhaps elaborate a bit on how you use the props
parameter to create the networkx
graph object?
Hi! Can you perhaps elaborate a bit on how you use the
props
parameter to create thenetworkx
graph object?
Sorry for the delayed reply, it's been a while since I used this package, I think props
should be a member of the created graph object using s2g, you can try to inspect the created object using debug mode.
Many thanks for coming back on this. I ended up going a different route, where I use GeoPandas
for importing the .shp
file and momepy
for converting the GeoDataFrame
into a networkx
graph. I still might come back to this and verify if s2g
does a better job of the graph conversion.
After I have converted shapefile to a nx graph, the information in the shapefile (e.g road name, coordinates) seems to be omitted. So how can I obtain the information? I need them to map the graph back to the shapefile.