2 ms·
Anecdote on Haversine: in 1.6, MongoDB's built-in "geonear" was using non-spherical indexing, but I needed to get more accurate results in a project, so I queri
by thibaut_barrere 16y ago
Anecdote on Haversine: in 1.6, MongoDB's built-in "geonear" was using non-spherical indexing, but I needed to get more accurate results in a project, so I queried 3 times more records and used Haversine afterward to sort records again, client-side. Here's the ruby code:
http://gist.github.com/559482 http://gist.github.com/559482
Since then, MongoDB 1.7 has been released with spherical sort support (http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-TheEarthisRoundbutMapsareFlat http://www.mongodb.org/display/DOCS/Geospatial+Indexing#Geos...)