stadiamaps / ferrostar

A FOSS navigation SDK built from the ground up for the future
https://stadiamaps.github.io/ferrostar/
Other
184 stars 24 forks source link

Evaluate conditions for preferring geodesics over haversine #329

Open ianthetechie opened 4 weeks ago

ianthetechie commented 4 weeks ago

Currently most of the distance calculations in Ferrostar are done with the haversine formula. This makes some simplifying assumptions, but it is widely used for its speed. We should probably keep doing this.

However, for cases where there could be a larger accumulation of errors, perhaps we should be using geodesics. An example of this is where one or more calculations add up to a trans-continental distance (as they might when computing the length of route sections).

We never really evaluated acceptable uses for each, and currently use a mix of both (partially due to bugs we found, such as panics on direct intersections in geo rust). We should research + standardize on this going forward.