Skip to main content
100%

Gist 877801

✓ Published0🌍 Public
CCaged
Last edited Mar 20, 2011
Created on Mar 19, 2011

This example demonstrates a debugging session for a geospatial query on a Portland crime database using MongoDB. The visualization is not a traditional chart but rather a log of command-line interactions in the MongoDB shell, revealing a critical bug in the `geoNear` command with spherical geometry. The author, Caged, queries crime records at a specific latitude/longitude coordinate and discovers that `$centerSphere` queries return no results due to a "spherical distance would require wrapping" error, while a `geoNear` command returns records at a distance of 1.803 even for the exact same location. The gist highlights the inconsistency and potential bug in MongoDB's spherical distance calculations, where identical coordinates yield non-zero distances. The visualization would likely plot these crime locations on a map, with a note or highlight on the unexpected distance value, illustrating the importance of accurate geospatial querying and the quirks of early MongoDB versions.

AI-generated description

Similar vizzes