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

How to derive travel time given list of OSM nodes? #5351

Closed
zyrgit opened this issue Jan 31, 2019 · 4 comments
Closed

How to derive travel time given list of OSM nodes? #5351

zyrgit opened this issue Jan 31, 2019 · 4 comments

Comments

@zyrgit
Copy link

zyrgit commented Jan 31, 2019

I have a question about deriving travel time given a list of OSM nodes like [5371582342, 2458643672, 2458643670, 5377378282]. Note that this sequence of nodes is not necessarily a routing results of OSRM, otherwise the duration could be obtained from the json result. Do I need to query duration of every pair of nodes and sum the duration up? Thanks for the answer.

@danpat
Copy link
Member

danpat commented Jan 31, 2019

@zyrgit OSRM has no index from OSM node to coordinate, so you can't pass the OSM node IDs in as input. Your best option would be to get the coordinates of those nodes, then do a /route query, using the coordinates as waypoints.

@zyrgit
Copy link
Author

zyrgit commented Jan 31, 2019

Thank you for the reply. I can easily get the Lat Lng of the OSM nodes, but when doing route query with waypoints, like "/route/v1/driving/-88.22219,40.114936;-88.2193765,40.1164187;-88.2527876,40.1347753;-88.2579482,40.1446107" if the coordinates are exactly at the intersections, it will give detour routes, I think OSRM didn't get the correct edges the coordinates are on. Even if I specify radius to "blur" waypoints, like pending "?radiuses=20;20;20;20" to the query, it still gives not the fastest route. Do you know how to solve this? Thank you.

@danpat
Copy link
Member

danpat commented Jan 31, 2019

Right - that problem is described over in #4465

Try using /match instead

@zyrgit
Copy link
Author

zyrgit commented Jan 31, 2019

Got it, thank you!

@zyrgit zyrgit closed this as completed Jan 31, 2019
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

2 participants