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

Fix distance calculation consistency #5316

Closed
3 tasks
danpat opened this issue Dec 16, 2018 · 0 comments · Fixed by #6315
Closed
3 tasks

Fix distance calculation consistency #5316

danpat opened this issue Dec 16, 2018 · 0 comments · Fixed by #6315

Comments

@danpat
Copy link
Member

danpat commented Dec 16, 2018

For various historical reasons, OSRM is using a mix of great circle distance, haversine distance, and https://github.com/mapbox/cheap-ruler-cpp to calculate distances in various points throughout the codebase. This leads to some weird behaviour, like route(A->B) giving a different distance to table(A->B).

We should use https://github.com/mapbox/cheap-ruler-cpp everywhere - it offers good performance, and very good precision (https://github.com/mapbox/cheap-ruler#precision) for the use-cases that OSRM cares about.

What'll change here:

  • Test data.js should be updated to more accurately place coordinates for test cases
  • Test results should be updated for new distances - my hope is to have more round numbers (100m, etc) for simple test cases, rather than lots of "100.1" or "99.8".
  • Some route selection might change due to slightly different distance being used to calculate edge costs. Impacts should be fairly small here, and will only show up in cases when two distances were very close.
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

Successfully merging a pull request may close this issue.

1 participant