3 ms·
simple solution: store the geohashes and compare prefixes, each prefix length is equivalent to a distance. https://en.wikipedia.org/wiki/Geohash#Digits_and_pre
by peoplefromibiza 4y ago
simple solution: store the geohashes and compare prefixes, each prefix length is equivalent to a distance.
https://en.wikipedia.org/wiki/Geohash#Digits_and_precision_in_km https://en.wikipedia.org/wiki/Geohash#Digits_and_precision_i...
you can use this pure Elixir library
https://hex.pm/packages/geohash https://hex.pm/packages/geohash
or this NIF that wraps a much faster C library
https://hex.pm/packages/geohash_nif https://hex.pm/packages/geohash_nif
or use one of the many geo libraries, like this one
https://github.com/yltsrc/geocalc https://github.com/yltsrc/geocalc