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

Floating point error of distance computation in geoNear

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Geo
    • Query Integration
    • ALL
    • Hide

      Run mongo/jstests/noPassthroughWithMongod/geo_axis_aligned.js and log the distances of the documents returned. Some of these calculated distances will be greater than their actual distance due to floating point error.

      Show
      Run mongo/jstests/noPassthroughWithMongod/geo_axis_aligned.js and log the distances of the documents returned. Some of these calculated distances will be greater than their actual distance due to floating point error.

      Documents near or on the boundaries of a geoNear search are susceptible to being excluded because the distance calculations in geoNear can produce inaccurate results due to floating point error (i.e. 54.001 - 54 > 0.001). Currently, this is accounted for in flat queries for by slightly expanding the last search interval and filtering with the TwoDPtInAnnulusExpression, but it is unclear if this handles all cases. Also, it may not be correct to return the documents if the distance calculation returns a value over the maxDistance.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            brandon.zhang Brandon Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: