maxdistance result of geoNear not scaled properly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Trivial - P5
    • None
    • Affects Version/s: 2.5.2
    • Component/s: Geo
    • None
    • Environment:
      Linux 3.2.0-51-generic #77-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
    • ALL
    • Hide

      (run in pymongo, python 2.7.3 64 bit)
      result =dBase.command("geoNear",collectionName, near=point, spherical=True, limit=queryLimit, distanceMultiplier=earthRadiusInKilometers, query=query)

      print "Average distance: " + str(result['stats']['avgDistance']) + " meter, maximum distance: " + str(result['stats']['maxDistance']) + ' meter.'

      Output:
      Average distance: 6963.35103921km, maximum distance: 0.00370436105903km.

      Show
      (run in pymongo, python 2.7.3 64 bit) result =dBase.command("geoNear",collectionName, near=point, spherical=True, limit=queryLimit, distanceMultiplier=earthRadiusInKilometers, query=query) print "Average distance: " + str(result ['stats'] ['avgDistance'] ) + " meter, maximum distance: " + str(result ['stats'] ['maxDistance'] ) + ' meter.' Output: Average distance: 6963.35103921km, maximum distance: 0.00370436105903km.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Using the geoNear command returns a structure that contains stats such as number of documents scanned, average distance and maximum distance. When using the distanceMultiplier parameter (to get values in meters, rather than degrees), the average distance is properly scaled using the distance multiplier, but the maximum distance is not scaled.

            Assignee:
            Siyuan Zhou
            Reporter:
            Tim van Kasteren
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: