Using 'gdf_to_nx()', I am not sure if I'm passing the additional weight data correctly #505
-
Hello there. I have a GeoDataFrame that has a network of trails, using momepy.gdf_to_nx() I was attempting to make a graph and get a path using nx.astar_path() The distance seems to be accurate, but I want to minimize time on the path, not distance. The gdf has a column "TRAVEL_TIME" that I'd like to use instead of a distance metric, however it appears that "TRAVEL_TIME" isn't being passed to the Graph; when running I am not sure if I should pass the information differently or if there is something else I'm missing. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Would you be able to provide a small reproducible example? The columns should be available on the graph normally but it is possible that you are hitting some unknown bug. |
Beta Was this translation helpful? Give feedback.
-
I had a data problem, not a python problem So when creating the example, it didn't work, but I typo'd the column "TRAVEL_TIME"; fixing it, the results are as expected. Upon some further exploration, the shapefile column name "TRAVEL_TIME" was actually TRAVELTIME and the readme was wrong. Feel a little silly, thanks for your response. Best, |
Beta Was this translation helpful? Give feedback.
I had a data problem, not a python problem
So when creating the example, it didn't work, but I typo'd the column "TRAVEL_TIME"; fixing it, the results are as expected.
Upon some further exploration, the shapefile column name "TRAVEL_TIME" was actually TRAVELTIME and the readme was wrong. Feel a little silly, thanks for your response.
Best,