[SERVER-12725] $box should be able to use a 2dsphere query if available and valid coords Created: 14/Feb/14 Updated: 17/Jun/16 Resolved: 16/Apr/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.5.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Ross Lawley | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Participants: | |||||
| Description |
|
In the following test case - I'd expect the $box query to be able to use the 2dsphere index rather than just a basic cursor.
Essentially the query is the same as - which will use the 2dsphere index
|
| Comments |
| Comment by Greg Studer [ 16/Apr/14 ] |
|
This isn't the same query - $box queries over a projected (flat) range, while a GeoJSON Polygon (by default) is a shape over the geographic (spheroidal) globe (WGS84 coordinate reference system (CRS)). This basically means the line segments connecting each vertex follow different paths - a horizontal line of latitude is not the shortest distance between two points on the globe (except at the equator). Basically extended shapes (lines, polygons) have nontrivial projections between the "2d" indexed space and "2dsphere" indexed space (points are special, since they're equal by convention and more-or-less define the projection). We're working on making more of the geo interface uniform though, ideally you'd want to be able to query flat shapes using GeoJSON syntax. This requires supporting more than just the default CRS. |
| Comment by Daniel Pasette (Inactive) [ 18/Feb/14 ] |
|
There is a planned effort to clean up and unify much of the geo user interface. This could be part of that effort. |