get_nearest_edges() does not distinguish between parallel edges
Problem description (what did you do, what did you expect to happen, and what actually happened)
get_nearest_edges() specifies each edge by returning the osmid of the "u" and "v" nodes for the edge. Because the graph is a MultiDiGraph and supports parallel edges, this function should return the Key of the edge as well. My suggested fix is as follows:
On line 461 in geo_utils.py, in the function get_nearest_edges(),
ne = edges.loc[eidx, ['u', 'v', 'key']]
Would you like to open a PR and I'll take a look?
Sure!
As noted there, it seems the issue I opened yesterday was a duplicate of this one. As such it's been closed in favor of discussion here.
II had a code solution suggested there as well, visible at https://github.com/gboeing/osmnx/issues/435. That said, it sounds like the above treats this as something that should be fixed rather than added as an option, which I agree with as a better approach. In that case all the places where I added if/else statements there could be reduced to just the part with the key, and the input variables could be removed. My local environment has finished reinstalling so if I get a moment today I'l try and submit a PR.
Pull request submitted #439.