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

$geoIntersects does not find the (right) polygon

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.4
    • Component/s: Geo
    • None
    • ALL
    • Hide

      Create a collection containing those two documents:

      { "_id" : 1, "geometry" : { "type" : "Polygon", "coordinates" : [ [ [ 2.119381, 41.33061 ], [ -174.006166, -90 ], [ -180, -90 ], [ -180, -8.695196 ], [ -2.19644, 40.196647 ], [ 2.119957, 41.335644 ], [ 2.120312, 41.333592 ], [ 2.119381, 41.33061 ] ] ] }, "type" : "Feature", "properties" : {  } }
      { "_id" : 2, "geometry" : { "type" : "Polygon", "coordinates" : [ [ [ 2.12758, 41.323953 ], [ 2.110699, 41.113954 ], [ -12.960389, -90 ], [ -174.006166, -90 ], [ 2.119381, 41.33061 ], [ 2.12758, 41.323953 ] ] ] }, "type" : "Feature", "properties" : {  } }
      

      The following query should return doc 2, but instead returns nothing:

      db.collection.find({"geometry":{$geoIntersects:{$geometry:{"type":"Point", "coordinates":[2.12127,41.32236]}}}})
      

      The following query should return doc 2, but instead returns doc 1:

      db.collection.find({"geometry":{$geoIntersects:{$geometry:{"type":"Point", "coordinates":[2.10154,41.29387]}}}})
      
      Show
      Create a collection containing those two documents: { "_id" : 1, "geometry" : { "type" : "Polygon" , "coordinates" : [ [ [ 2.119381, 41.33061 ], [ -174.006166, -90 ], [ -180, -90 ], [ -180, -8.695196 ], [ -2.19644, 40.196647 ], [ 2.119957, 41.335644 ], [ 2.120312, 41.333592 ], [ 2.119381, 41.33061 ] ] ] }, "type" : "Feature" , "properties" : { } } { "_id" : 2, "geometry" : { "type" : "Polygon" , "coordinates" : [ [ [ 2.12758, 41.323953 ], [ 2.110699, 41.113954 ], [ -12.960389, -90 ], [ -174.006166, -90 ], [ 2.119381, 41.33061 ], [ 2.12758, 41.323953 ] ] ] }, "type" : "Feature" , "properties" : { } } The following query should return doc 2, but instead returns nothing: db.collection.find({ "geometry" :{$geoIntersects:{$geometry:{ "type" : "Point" , "coordinates" :[2.12127,41.32236]}}}}) The following query should return doc 2, but instead returns doc 1: db.collection.find({ "geometry" :{$geoIntersects:{$geometry:{ "type" : "Point" , "coordinates" :[2.10154,41.29387]}}}})
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      For some points and polygons, $geoIntersects() returns either no result or a neighboring polygon instead of the expected polygon.

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            Kibour Marc Bourqui [X]
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: