[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 SERVER-772, but obviously this won't fix $near results errors.

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 SERVER-1342
Was in 1.7.0

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.

Generated at Thu Feb 08 02:55:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.