[SERVER-823] Geospatial indexing should work with spherical surfaces Created: 24/Mar/10 Updated: 29/May/12 Resolved: 12/Nov/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Hubert Lepicki | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Duplicate | Votes: | 13 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Geospatial indexing, and querying those data assumes that a surface is Cartesian surface (flat). This is not the case with the Earth. Treating geographical coordinates as Cartesian coordinates, leads to obvious errors. I believe $center and $box queries could possibly be "fixed" by most people by upcoming search within polygon It is very desired that there is some kind of specifying that geospatial index should work with sphere, not flat surface. Maybe a way to do it from user's point of view would be: db.places.create_index( {location: ["2d", 6500]}) Specifying radius of sphere this way would make sense for people who want to use different units than kilometers, or map things on different surfaces (Mars, anyone?). |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 12/Nov/10 ] |
|
This was done with |
| Comment by David Lee [ 13/Jun/10 ] |
|
There has been initial discussions on http://groups.google.com/group/mongodb-dev/browse_thread/thread/994a2819d0115e02 for adding "sphere" indexing. I'm not sure what the progress on this is, though. |
| Comment by Hubert Lepicki [ 24/Mar/10 ] |
|
An alternative to this, would be to have 3-dimensional, or N-dimensional if done more flexible way, geospatial indexing. This solution would allow users to use all 3 geographical coordinates, but would require them to convert them into some kind of 3d Cartesian coordinates. This is not hard, and additional gain is that you can calculate real distances between places, taking into consideration their height above sea level. I think this is suggested in ticket SERVER-691, which is even better than what I suggest. |