Anyone knows how the geospatial indexing works, i mean the algorithm to calculate nearest points?
In SQL we may do things like this:
SELECT id, (x-a)*(x-a)+(y-b)*(y-b) as distance FROM table1 ORDER by distance ASC
Sure this is not efficient enough compared with mongodb’s geospatial indexing, but how does mongodb calculate and sort?
Many thanks in advance.
Heart of mongodb geospatial is Geohashes. Geohash is a
I couldn’t find the appropriate links for the geohash implementations in mongo, but this thread might give some insights.