[SERVER-3038] Spherical distance trying to wrap when not required Created: 04/May/11  Updated: 30/Mar/12  Resolved: 09/May/11

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 1.8.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Damien Vouriot Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 2.6.36-ARCH #1 SMP PREEMPT Fri Dec 10 20:32:37 CET 2010 x86_64 Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz GenuineIntel GNU/Linux


Operating System: ALL
Participants:

 Description   

Here is what I am trying to do :
> db.locations.save(

{"loc" : [ 1.2999999523162842, 103.86000061035156 ]}

)
> db.locations.find()

{ "_id" : ObjectId("4dc121bc8c001c37f7238139"), "loc" : [ 1.2999999523162842, 103.86000061035156 ] }

> db.locations.ensureIndex(

{ loc : "2d" }

)
> db.locations.find({loc : { $within :

{ $centerSphere : [[1.29674806757343, 99.847579956055], 0.0003139224611520954]}

}})
error: {
"$err" : "Spherical distance would require wrapping, which isn't implemented yet",
"code" : 13462
}

I checked this bug https://jira.mongodb.org/browse/SERVER-2408
But in my case, I am not trying to use large distance.

I got the same error with following centers :
[-33.8726005554199, 151.195999145508]
[13.7576999664307, 100.490997314453]

and even with shorter distance.

As I am not sure about the expected behavior, and when wrapping is required, apologize if this is not a bug



 Comments   
Comment by Damien Vouriot [ 09/May/11 ]

I confirm, it was the issue, my mistake, sorry

Thanks

Comment by Greg Studer [ 09/May/11 ]

Spherical queries take coordinates in longitude (-180, 180) / latitude (-90, 90) terms. Seems like you have yours reversed, which results in this (admittedly obscure) error - see SERVER-2980 for when the new code with the earth bounds checking will be integrated.

Generated at Thu Feb 08 03:01:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.