googlemaps / googlemaps/js-markerclusterer
[Feature Request] Use mapbox/cheap-ruler (not Haversine) for GPS distance calculations
- Dominant language
- TypeScript
- Stars
- 293
- Forks
- 104
- Avg merge
- 3m
- Merged PRs (30d)
- 18
Description
Have a look at mapbox/cheap-ruler:
blog: https://blog.mapbox.com/fast-geodesic-approximations-with-cheap-ruler-106f229ad016
code: https://github.com/mapbox/cheap-ruler
It has very fast point-to-point geo-distance calculations. It uses only 1 Latitude based trig call, once! And, it is usually more accurate than Haversine (it is an approximation of a more accurate formulae based on the Earth's actual shape, a squashed sphere, not a sphere) . This is a dramatic speedup for geo-distance calculations.
Either get the median Latitude for the markers, or do per degree (e.g. 23.5 to 24.5 ~ 24), do the 1 trig call, then all point-to-point distance calculations are trig-free.
Contributor guide
Assessment
This issue has not been assessed yet.