[SERVER-1246] Wrong collections for geospatial $within $center Created: 17/Jun/10  Updated: 04/Jul/10  Resolved: 17/Jun/10

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

Type: Bug Priority: Major - P3
Reporter: Alex Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu karmic 9.10
root@unix:/var/lib/mongodb# mongod --version
db version v1.5.2, pdfile version 4.5
Thu Jun 17 15:15:06 git version: 03817ed01653204ca474f402e64d54c94ebb1094


Operating System: Linux
Participants:

 Description   

[PHP]
$criteria=array('loc'=>array('$within'=>array('$center'=>array(array(51.5221425, -0.1098127),10))));

Returns results upto 150 miles away

-OR-

[MONGO-SHELL]
center=[51.5221425, -0.1098127];
radius=10;
db.vacs.find({"loc" : {"$within" :

{"$center" : [center, radius]}

}})

Returns the same results upto 150 miles away.

The table was built form a mysql import where it returns the correct results so I know the data is correct if that helps at all



 Comments   
Comment by Eliot Horowitz (Inactive) [ 17/Jun/10 ]

Reminder - radius is in lat/lng so 1=~70 miles

Comment by Alex [ 17/Jun/10 ]

Here is the data that is being sent to the server (in Json) - which looks correct to me.

{"loc":{"$within":

{"$center":[[51.5221425,-0.1098127],10]}

}}

Here is the data it returns (first 20 anyway)
26994 London(rough area) 51.51(lat) -0.13(long)
26993 Edinburgh(rough area) 55.95(lat) -3.2(long)
26992 London(rough area) 51.5906237(lat) -0.1977723(long)
26985 London(rough area) 51.51(lat) -0.13(long)
26984 London(rough area) 51.51(lat) -0.13(long)
26982 London(rough area) 51.51(lat) -0.13(long)
26980 Lancashire(rough area) 53.7519721(lat) -2.7136495(long)
26979 Hampshire(rough area) 51.262177(lat) -1.087183(long)
26978 London(rough area) 51.51(lat) -0.13(long)
26977 Cheshire(rough area) 53.2589493(lat) -2.5166068(long)
26976 London(rough area) 51.51(lat) -0.13(long)
26975 London(rough area) 51.51(lat) -0.13(long)
26974 Greater London(rough area) 51.6110945(lat) -0.1535887(long)
26973 Brighton(rough area) 50.83(lat) -0.14(long)
26972 North West(rough area) 53.625457(lat) -2.613829(long)
26971 London(rough area) 51.51(lat) -0.13(long)
26970 Reading(rough area) 51.43(lat) -1(long)
26969 London(rough area) 51.51(lat) -0.13(long)
26968 Bracknell(rough area) 51.4162987(lat) -0.7530059(long)
26967 Manchester(rough area) 53.48(lat) -2.24(long)

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