[SERVER-9948] Cannot index a polygon crossing the 180th meridian Created: 17/Jun/13 Updated: 25/Apr/18 Resolved: 26/Jun/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.4.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Frédéric De Jaeger | Assignee: | hari.khalsa@10gen.com |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux |
||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Participants: | |||||||||
| Description |
|
I could not find a way to index a polygon (rectangle) crossing the 180th meridian. but it fails with the infamous error "Can't extract geo keys from object, malformed geometry?". If I normalize the coordinates to not overflow +-180, then I don't see how mongodb could distinguish that small polygon from a large band going from meridian -165 to meridian +175. I could try to split my polygon into two across the 180 meridian but then I fall onto https://jira.mongodb.org/browse/SERVER-8907 |
| Comments |
| Comment by hari.khalsa@10gen.com [ 26/Jun/13 ] |
|
-185 isn't a valid longitude, so use 175, and it will work. MongoDB always uses the smallest possible shape defined by a loop. Either we need to enforce a winding order on the vertices of a loop (contain everything to the left or to the right of the edges as we traverse them), or we need to always use the smallest (or largest) possible shape defined by a loop. We opt for always using the smallest shape defined by a loop. As for |
| Comment by Frédéric De Jaeger [ 17/Jun/13 ] |
|
I forgot to mention that I'm using the 2dsphere index. |