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

Inconsistency of duration between route and table service for identical coordinates #7086

Closed
hklarner opened this issue Dec 14, 2024 · 2 comments
Labels

Comments

@hklarner
Copy link

I have noticed that routing along three coordinates frequently results in a different total duration when compared with the same coordinates in a table call and sum of durations.

Example:

# table service
http://router.project-osrm.org/table/v1/car/13.401527133953232,52.49691894523965;13.397105630079224,52.49764574610592;13.400278578988658,52.498914605838394
duration = 167.2

# route service
http://router.project-osrm.org/route/v1/car/13.401527133953232,52.49691894523965;13.397105630079224,52.49764574610592;13.400278578988658,52.498914605838394
duration = 216

Can anyone briefly explain why that happens?

Also I have compared distances between pairs of coordinates and they seem to always be equal.

Final question: we use table for vehicle routing and route for displaying solutions and it is a bit counter intuitive that the routes we compute actually have different lengths when we draw them, so is there a parameter setting that guarantees that route and table result in identical durations?

@jcoupey
Copy link

jcoupey commented Dec 16, 2024

When considering 167.2 = 104.7 + 62.5 from the durations matrix you're looking at trip pairs independently, not an actual route through the middle point, and what you get is a route with a U-turn. The route request does not have this U-turn enabled by default. You'll get the same consistent result if adding ?continue_straight=false.

@hklarner
Copy link
Author

Makes sense and can confirm that ?continue_straight=false fixes the inconsistency. Thanks!

@jcoupey jcoupey closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants