-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix distance calculation consistency #5316
Copy link
Copy link
Closed
Description
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.jsshould 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels