3 ms·
The generally correct answer is: PostGis. If approximate distances (with known error bounds that depend on lat/long) is appropriate then string prefix matching
by nl 5y ago
The generally correct answer is: PostGis.
If approximate distances (with known error bounds that depend on lat/long) is appropriate then string prefix matching on GeoHash[1] is easy and quite beautiful in many ways.
Basically locations within the same X character string code will be within a known lat/long square of each other. The longer the string the smaller the lat/long square.
[1] https://www.movable-type.co.uk/scripts/geohash.html https://www.movable-type.co.uk/scripts/geohash.html, https://en.wikipedia.org/wiki/Geohash https://en.wikipedia.org/wiki/Geohash