Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13721

geoNear calculated distance discrepancy

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.1-rc0
    • Component/s: Geo
    • None
    • Query
    • ALL
    • Hide
      db.location.drop()
      db.location.save({"_id":1, "position" : [-74.044628, 40.689182]})
      db.location.save({"_id":2, "position" : [-74.041243, 40.700309]})
      db.runCommand( { geoNear : "location" , near : [-74.045255, 40.702554], spherical : true } ).results[0].dis
      db.runCommand( { geoNear : "location" , near : { type : "Point" , coordinates: [-74.045255, 40.702554] } , spherical : true } ).results[0].dis
      
      Show
      db.location.drop() db.location.save({"_id":1, "position" : [-74.044628, 40.689182]}) db.location.save({"_id":2, "position" : [-74.041243, 40.700309]}) db.runCommand( { geoNear : "location" , near : [-74.045255, 40.702554], spherical : true } ).results[0].dis db.runCommand( { geoNear : "location" , near : { type : "Point" , coordinates: [-74.045255, 40.702554] } , spherical : true } ).results[0].dis

      The geoNear distance results coming back for legacy coordiante pairs (radians) & GeoJSON (meters) for 2.6.1.RC0 differ from 2.4.10.

      Step 4 results (radians) 2.4.10 vs 2.6.1:
      0.00006597925143247339
      0.0000659798416616995

      Step 5 results (meters) 2.4.10 vs 2.6.1:
      420.82226356145856
      420.82602810248557

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            jonathan.abrahams Jonathan Abrahams (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: