Re:MongoDB Interactive Geospatial Tutorial
by mathias_10gen on Tuesday April 05, 2011 @11:47AM
(#2411380)
If you haven't seen it already, a quick Google hack for computing the radians to input into MongoDB:
http://www.google.com/search?q=50+km+%2F+radius+of+earth http://www.google.com/search?q=50+miles+%2F+radius+of+earth
Re:MongoDB Interactive Geospatial Tutorial
by joelhaasnoot on Tuesday April 05, 2011 @04:21PM
(#2412535)
Yes, my code is just range/6418 or so. It just produces unexpectedly slow results when you don't realize :)
One thing you leave out is the $nearSphere and related commands which can be used since MongoDB 1.7 or so to create better radiuses. It makes searching just that little more precise. There is one twist for it that had me stuck for a bit: the radius is in radians when using those commands.
Other than that: MongoDB makes it very very easy to create a location based mobile service. Throw in some node.js and some JSON, and you're set.