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

$geoWithin picks points outside of polygon

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.9
    • Component/s: Geo
    • Environment:
      OSX 64
    • ALL

      Given 3 points:

      { "_id" : "1", "name" : "b",  "loc" : { "coordinates" : [ -121, 47.134296 ], "type" : "Point" }, "description" : ""}
      { "_id" : "2", "name" : "a",  "loc" : { "coordinates" : [ -120, 47.234296 ], "type" : "Point" }, "description" : ""}
      { "_id" : "3", "name" : "c",  "loc" : { "coordinates" : [ -125, 49.134296 ], "type" : "Point" }, "description" : ""}
      

      The following query returns 2 results - first 2 objects (with id-s 1 and 2 ) even though their latitude lays outside of given polygon.

      db.SimpleVisits.find( { "loc" : { "$geoWithin" : { "$geometry" : 
                                          { "type" : "Polygon" , 
                                          "coordinates" : [ [ [ -100.0 , 46.5] , [ -130.0 , 46.5] , [ -130.0 , 40.01] , [ -100.0 , 40.01] , [ -100.0 , 46.5]]]}}}})  
      

        1. flat-map.png
          flat-map.png
          1.63 MB
        2. great-arc.png
          great-arc.png
          530 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            kgignatyev Konstantin Ignatyev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: