[SERVER-34673] Create Index does not support GeoJSON that cross the meridian Created: 25/Apr/18 Updated: 25/Apr/18 Resolved: 25/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ching Chang | Assignee: | Kevin Albertson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: |
|
||||||||
| Participants: | |||||||||
| Description |
|
I have a large GeoJSON collection with some polygons that crosses the date line. Because of that these polygons, I am not able to create a 2dsphere index on the collection. Different GIS tools handle this use case differently. Some opts to support longitude that < -180 and > 180 to represent shapes that cross the merdian the short way, instead of the long way (across the other side of the globe). MongoDB as a database system that stores these data, should be generic enough to handle this use case. |
| Comments |
| Comment by Kevin Albertson [ 25/Apr/18 ] | ||||
|
Hi Ching, Coordinates are considered out of bounds if the longitude falls outside of [-180, 180] or the latitude falls outside of [-90, 90]. Converting the out of bounds coordinates to in bounds allows this shape to be indexed:
If possible, you could preprocess your data to convert any out of bounds points to wrap around. |