[SERVER-2408] $within $centerSphere not implemented Created: 25/Jan/11 Updated: 25/Jan/11 Resolved: 25/Jan/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 1.7.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Greg Studer |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 7 64 bit using latest server build downloaded 2011-01-25 |
||
| Operating System: | ALL |
| Participants: |
| Description |
|
When I run this query using the C# driver: "{ \"Location\" : { \"$within\" : { \"$centerSphere\" : [[-74, 40.74], 1] }} }" I get this error: MongoDB.DriverOnlineTests.MongoCollectionTests.TestFindWithinCircleSphericalTrue: ) Here's the same error reproduced in shell: > use onlinetests > db.testcollection.find({ "Location" : { "$within" : { "$centerSphere" : [[-74, 40.74], 1] } } }) |
| Comments |
| Comment by Greg Studer [ 25/Jan/11 ] |
|
The $centerSphere query isn't really designed for very large distances (yet), try using a smaller value on the order of hundreds of km (also see http://groups.google.com/group/mongodb-user/browse_thread/thread/b062e3a251f16d7e for another discussion). Note that the distance measure is in radians, where 1 radian given the radius of the earth is > 6000 km |