[SERVER-24251] $geoIntersects does not find the (right) polygon Created: 23/May/16 Updated: 20/Jun/16 Resolved: 20/Jun/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 3.2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Marc Bourqui [X] | Assignee: | Kelsey Schubert |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL | ||||
| Steps To Reproduce: | Create a collection containing those two documents:
The following query should return doc 2, but instead returns nothing:
The following query should return doc 2, but instead returns doc 1:
|
||||
| Participants: |
| Description |
|
For some points and polygons, $geoIntersects() returns either no result or a neighboring polygon instead of the expected polygon. |
| Comments |
| Comment by Kelsey Schubert [ 20/Jun/16 ] | ||||||||
|
Hi Kibour, The second polygon is not valid as it self-intersects. If you attempt to create a 2dsphere index using this data the resulting error provides additional information.
If you need to query against this shape, I would suggest converting into a MultiPolygon to resolve the ambiguity inherent to self-intersecting polygons. Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-users group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-users group. Kind regards, | ||||||||
| Comment by Marc Bourqui [X] [ 23/May/16 ] | ||||||||
|
Indeed, I was checking using geojsonlint.com, and my polygons looked good there.
| ||||||||
| Comment by Ramon Fernandez Marina [ 23/May/16 ] | ||||||||
|
Kibour, those polygon definitions look a bit strange. Please note that using something like geojsonlint.com may not be the best way to test geo coordinates – can you please check your geometries at https://s3.amazonaws.com/geodndmap/index.html ? This site is a hosted version of geodndmap, and provides accurate representation of geo coordinates. |