You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After reading the relevant issues in the pandana project (see here), I figured out that this issue is due to the fact that nodes.id does not contain all of ids included in edges.u or edges.v. Plotting the relevant edges makes it clear that this is likely due to how the bounding box code is implemented when creating the OSM object. The following code:
Describe the bug
Following this pandana example with an
OSM
reader object created using a bounding box raises aValueError
on theosm.to_graph
step.To Reproduce
Steps to reproduce the behavior:
where
bbox
is a bounding box that cuts through an edge.Expected behavior
The
osm.to_graph
function should produce a graph without additional tinkering on either thenodes
oredges
dataframes.Environment:
Additional context
Here's the error log from the code
After reading the relevant issues in the
pandana
project (see here), I figured out that this issue is due to the fact thatnodes.id
does not contain all of ids included inedges.u
oredges.v
. Plotting the relevant edges makes it clear that this is likely due to how the bounding box code is implemented when creating theOSM
object. The following code:produces:
Adding a line of code to clean up the
edges
gdf fixes the problem, of course, but it would be nice to not have to remember to do that.I imagine that this could be fixed by adding the following line of code around here:
Some alternate ideas:
pyrosm.frames.prepare_geodataframe
could be modified to include the "lost" nodes or exclude the "extra" edgespyrosm.pyrosm.OSM.get_network
andpyrosm.networks.get_network_data
The text was updated successfully, but these errors were encountered: