[SERVER-46787] Support geoJson with 2d index Created: 11/Mar/20 Updated: 27/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Geo, Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Damiano Barboni | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | qi-geo | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Assigned Teams: |
Query Integration
|
| Participants: |
| Description |
|
As documented here https://docs.mongodb.com/manual/core/2d/ 2d Indexes can not be used to store GeoJSON and for this kind of geometries the correct index should be the 2dsphere. Trying to load polygons conceived in a plane with a 2dsphere index is possible to receive an error like:
I don't want to discuss the error above, for me is clear. The problem is that there are professional sectors where most of the available geometry resources are "flat" and also the adopted software tools make this assumption. The error above for example refers to the polygon of a Sentinel dataset provided by the ESA but affects also datasets/geometry provided by NASA, USGS and so on. The provided field of view of this rasters are not wrong but are coordinates mapped on a plane not on a sphere. Sorry if I went too long. Summarising, what in my opinion should be useful is the support of geoJson also with a 2d index. Thanks Damiano |
| Comments |
| Comment by Damiano Barboni [ 22/Oct/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi @kateryna.kamenieva , The query below try to insert a polygon that came from a Sentinel dataset and is an example of a geometry that is valid on a "flat Earth" but not with the 2dsphere index. I tried to found a way to handle this error but until now, in case of exception, the only workaround is to replace the real dataset footprint with a rectangular bounding box.
The error:
The following image represent the polygon on a 2D geoJson viewer
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Katya Kamenieva [ 07/Oct/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi barboni@meeo.it, We are not planning on developing 2d indexes further, but ability to operate on the flat coordinate system is a feature that we will consider in the future. Currently, it is not scheduled for implementation. Could you provide an example of the dataset and what kind of queries you are looking to run against it? I'd like to understand if geospatial query operators and geoJSON geometries that exist in MongoDB today would satisfy your use case? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Sedor [ 11/Mar/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for the detailed description, barboni@meeo.it. We're assigning this ticket to the appropriate team to be evaluated against our currently planned work. Updates will be posted on this ticket as they happen. Eric |