[SERVER-24440] Points near the poles may fail to be returned by $nearSphere with 2d index Created: 07/Jun/16 Updated: 27/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Geo, Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Max Hirschhorn | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | open_todo_in_code, qi-geo, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||||||
| Assigned Teams: |
Query Integration
|
|||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||
| Steps To Reproduce: | Apply the following patch and run python buildscripts/resmoke.py --executor=no_passthrough jstests/noPassthrough/geo_full.js.
|
|||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||
| Linked BF Score: | 0 | |||||||||||||||||||||||||
| Description |
|
The GeoNear2DStage has its own implementation for projecting a spherical region to a flat annulus. siyuan.zhou and I read through the code and suspect the issue is with the computeXScanDistance() function, but aren't clear on the details (read: math) that cause $nearSphere queries to omit points from the flat annulus that were included in the spherical region.
As a workaround, one can perform the $nearSphere queries with a "2dsphere" index to get the expected results. Note: This is a separate issue from the one reported in SERVER-21594, as the $maxDistance specified in to the $nearSphere query doesn't necessarily cause it to cross over the pole. Additionally, $geoWithin queries that use $centerSphere don't appear to be affected by this issue because they use the S2 library to perform the projection from the spherical region to the flat box. |
| Comments |
| Comment by Siyuan Zhou [ 07/Jun/16 ] |
|
I'd vote for stopping supporting spherical query with 2d index as 2dsphere index has been mature, correct and fast. |