[SERVER-9957] Some polygons are refused by the 2dsphere index Created: 18/Jun/13 Updated: 29/Jan/15 Resolved: 25/Jun/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Frédéric De Jaeger | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux |
||
| Operating System: | Linux |
| Steps To Reproduce: | MongoDB shell version: 2.4.3 ) // this one works, observe the subtle difference. > db.mycol.save({"loc":{"type":"Polygon","coordinates":[[[-116.0,-87.0181],[64.0,-85.0181],[64.0,-71.0181],[-116.0,-71.0181],[-116.0,-87.0181]]]}}) |
| Participants: |
| Description |
|
There are some GeoJSON polygons that are refused by the 2dsphere index ("Can't extract geo keys from object, malformed geometry") |
| Comments |
| Comment by Ian Whalen (Inactive) [ 25/Jun/13 ] |
|
Hi thoran - I'm closing this for now, but please feel free to open a separate feature request in re the rectangle primitive if you'd like to discuss the idea with a developer. |
| Comment by Frédéric De Jaeger [ 19/Jun/13 ] |
|
My fault. Got bitten by the geodesics. It would be nice to have a Rectangle primitive for indexing and querying with the 2dsphere index. I'm sure we are not the only one trying to represent google maps frame with a GeoJSON Polygon and this is incorrect, especially for large area. |
| Comment by Derick Rethans [ 18/Jun/13 ] |
|
I think this is actually an invalid polygon, as it's a single line crossing the South Pole... (116 + 64 = 180). This is a nice visualisation: |
| Comment by Frédéric De Jaeger [ 18/Jun/13 ] |
|
sorry I made a copy paste error, here is the command that fails to work for no good reason: > db.mycol.save({"loc":{"type":"Polygon","coordinates":[[[-116.0,-87.0181],[64.0,-87.0181],[64.0,-71.0181],[-116.0,-71.0181],[-116.0,-87.0181]]]}}) the one provided in the "step to reproduce" is really invalid (first and last vertex mismatch) |