googlemaps / googlemaps/js-markerclusterer

[Feature Request] Use mapbox/cheap-ruler (not Haversine) for GPS distance calculations

Open
#1,031 0 comments 1 reaction 0 assignees View on GitHub
triage me type: feature request
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.