-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Geo
-
Query Integration
-
ALL
-
(copied to CRM)
db.polygon.drop(); db.polygon.insert([ { "_id" : "Poly1", "shape" : { "type" : "Polygon", "coordinates" : [ [ [0.0000, 0.000],[3.000,0.000],[3.000,3.000],[0.000,3.000], [0.0000, 0.000]]]}}, ... { "_id" : "Poly2", "shape" : { "type" : "Polygon", "coordinates" : [ [ [3.00,0.00],[6.00,0.00],[6.00,3.00],[3.00,3.00],[3.00,0.00] ] ] } } ]); db.polygon.ensureIndex({shape:"2dsphere"}); var box={"type" : "Polygon", "coordinates" : [ [ [ 0.000, 0.0000 ], [ 3.0000, 0.0000 ], [ 3.000, 3.000 ], [ 0.000, 3.000 ], [ 0.000, 0.0000 ] ] ] } db.polygon.find( {shape: {$geoIntersects: {$geometry: box}}}, {_id:1}) { "_id" : "Poly1" }
Poly2 and box share two adjacent points [ 3.0000, 0.0000 ] and [ 3.000, 3.000 ] so Poly2 should be returned, but it's not.
Analogously, using box of points from Poly2 will only match Poly2 and not Poly1.
Our docs say: A location intersects a GeoJSON object if the intersection is non-empty. This includes documents that have a shared edge.
This happens in 2.4 (v1) and 2.6(v2). It happens with line/polygon and polygon/polygon intersections.
- is duplicated by
-
SERVER-12462 $geoWithin query doesn't return a point on the pole with 2dsphere index
- Closed
- is related to
-
SERVER-17851 $geoWithin and $geoIntersects do not match the query polygon's border
- Backlog