Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-36

The documentation of $near seems wrong, or at least confusing

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      The second bullet point describing the spherical coordinates states that "All distances use radians", and continues with "... multiply by the radius of the earth (about 6371 km or 3959 miles) to get the distance in your choice of units." Given the circumference of the earth being 2*pi*radius and the entire circle being 2*pi (radians) then one radian at the surface of the earth would be equal to the earth's radius, which is 3959 miles.
      http://www.mongodb.org/display/DOCS/Geospatial+Indexing#GeospatialIndexing-NewSphericalModel
      On the other hand the last comment in SERVER-813 says that one (radian) corresponds to 69 miles on the surface of the earth. Some empirical testing suggests that this is indeed the accurate measure.
      http://jira.mongodb.org/browse/SERVER-813?focusedCommentId=19076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_19076

      However if we assume we're talking about one good old degree (1/360 of a circle) it does make more sense. One degree would measure 1/360 * 2*pi*radius at the surface, which does indeed compute to about 69 miles.

      I would therefore propose that the documentation say "All distances use decimal degrees, just like the coordinates themselves". At least among my peers that seems to cause less confusion.

      Attachments

        Activity

          People

            greg_10gen Greg Studer
            knut Knut Forkalsrud
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12 years, 46 weeks, 6 days ago