[SERVER-19328] $geoIntersects does not work as expected Created: 08/Jul/15 Updated: 09/Jul/15 Resolved: 08/Jul/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Mateusz Jaworski | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
Collection content: }) The following query does not return anything (the searched shape is totally within the polygon): But when we shrink the polygon just a little (160->150, the shape is still inside), we get the expected result: I chose the values to be round and nice, but this appeared many times for the others and I did not find any pattern. I tested it on 3 different mongodb versions: 3.0.4, 2.6.5 and 2.6.9. I tested also with changing points order and custom crs. This example works with setting crs to "urn:x-mongodb:crs:strictwinding:EPSG:4326", but I can find also other examples that failed. My case is filtering the polygons of countries borders by the visible area and on large polygons (but much smaller than half of the sphere) couple of countries was always missing in the result. I have no idea if I do sth wrong or this is a bug. |
| Comments |
| Comment by Sam Kleinman (Inactive) [ 09/Jul/15 ] |
|
We have a tool https://geodndmap.mongodb.com that you can drag geoJSON strings onto the window to plot geometries. Be aware, it doesn't handle invalid GeoJSON/geometries very well. |
| Comment by Mateusz Jaworski [ 09/Jul/15 ] |
|
OMG. You are right. It is great that you will add this to documentation for other dummies like me. What did you use for making this map image with polygons? Thanks! |
| Comment by Sam Kleinman (Inactive) [ 08/Jul/15 ] |
|
I believe that this is an expected behavior and an effect of map distortion. I've attached a plot of the points you describe, which I think illustrates your results.
Cheers, |