Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortest path between two OSM nodes #5886

Closed
HumamHelfawi opened this issue Nov 18, 2020 · 2 comments
Closed

Shortest path between two OSM nodes #5886

HumamHelfawi opened this issue Nov 18, 2020 · 2 comments

Comments

@HumamHelfawi
Copy link

HumamHelfawi commented Nov 18, 2020

I want to compute shortest path between OSM node 1765878706 & 1765878672. Using OSRM, I am getting this result:
image

Why the shortest path was not simply like this:
image

Any hint is much appreciated.

@danpat
Copy link
Member

danpat commented Nov 18, 2020

You're seeing a manifestation of #4465

When you supply a coordinate that is equidistant from several edges, the one chosen to start the route on will be somewhat random.

When there are one-ways involved, this may force a seemingly unnecessary detour, as in your case. The edge being chosen is the south-bound one, and there is no other way to go.

There are two possible fixes here:

  1. You workaround the issue by slightly moving your start coordinate in the desired direction, or by using the bearings= parameter to filter out the southbound candidates. This can be done on a case-by-case basis, but isn't easy to do for the general case.
  2. Someone implements multi-start routing in our core routing algorithms, so that all equidistant snapping points are considered as starting candidates. This is a much larger effort.

@SiarheiFedartsou
Copy link
Member

Point 2 seems to be implemented in #5953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants