[SERVER-21594] Incorrect wrapping of spherical query near the poles on 2d index Created: 20/Nov/15 Updated: 28/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Siyuan Zhou | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | qi-geo, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Integration
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
In this build failure, the S2 cap near the pole gives a bound covering it, but 2d index interprets it literally to the following box, whose longitudes should be (179.005 -->> -110.896) instead, on the other side of the earth.
The other failure of nearSphere seems the same problem as it is also very close to the pole. For nearSphere we expands the search area though. We should deprecate the support of spherical queries on 2d index and prohibit them in the future. As a workaround, spherical queries using 2dsphere index work as expected. |
| Comments |
| Comment by Siyuan Zhou [ 20/Nov/15 ] |
|
It's interesting that the test indeed tries to avoid wrapping by limiting the range of search area. However the bounding box of the search area is what really matters here and may exceed that range. We can be more conservative here by limiting longitude to [-170, 170] and latitude to [-70, 70] for spherical queries. |
| Comment by Eric Milkie [ 20/Nov/15 ] |
|
In the meantime, should we reduce the randomness of the geo_full.js code? We could choose some likely hardcoded example points and polygons. I would like to do something to stop the test from randomly failing until we can fix the code. |