Sosh
unread,May 4, 2012, 6:06:13 AM5/4/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Hi,
I have a collection with a Geospacial index for it's a simple catesian
system (only integers).
I have my index set up like this:
dbMapData.ensureIndex([{ loc : "2d" }, { min : -10000000000 , max :
10000000000 }], true, function(err, res){}); //Abitrary large min/max
And my query:
dbMapData.find({"loc" : {"$within" : {"$box" :
box}}}).toArray(function (err, array) {...
I'm looping though diffent box values. This seems to work well, until
I reach a certain y value, then I am hit with the 'need an area > 0'
error. However, I don't understand why I'm getting this error, as the
query that causes it is no different to the others. I was wondering
if it might be an index min/max issue?
My debug output is below (box coords are x1,y1,x2,y2):
maprange request. box: -50,0,99,149
maprange request took 9 ms to query
maprange request. box: -50,50,99,199
maprange request took 6 ms to query
maprange request. box: -50,100,99,249
maprange request took 6 ms to query
maprange request. box: -50,150,99,299
maprange request took 1 ms to query
maprange request. box: -50,200,99,349
maprange request took 1 ms to query
maprange request. box: -50,250,99,399
maprange request took 24 ms to query
maprange request. box: -50,300,99,449
maprange request took 2 ms to query
maprange request. box: -50,350,99,499
maprange request took 1 ms to query
maprange request. box: -50,400,99,549
maprange request took 18 ms to query
maprange request. box: -50,450,99,599
maprange request took 6 ms to query
maprange request. box: -50,500,99,649
need an area > 0
Thank you!