Start a new topic

Problem with finding points inside the box

Hello,

I'm doing a search within box. It works perfect except only one situation. Let me describe it.

Suppose the point has coordinates: (lng:-155, lat:19)

If we have box: sw - (-170, 10), ne (29,69) that everything is fine and we can find this point because it's inside of this box.

But if we move the box a little bit and now it's coordinates are sw - (144, 10), ne (-75,69) that results are zero although the point is still inside of this box.

Please see the picture describing. Maybe I misunderstand how the search "within" box but in this case could you please tell me how to do it properly in the second situation. Thanks!!

(https://c3409409.ssl.cf0.rackcdn.com/kinvey.vanillaforums.com/editor/mc/ljt98x9ttd0h.png "")


Better picture:

(https://c3409409.ssl.cf0.rackcdn.com/kinvey.vanillaforums.com/editor/to/s7najniri4vw.png "")

Nobody knows?
Hey Kath, you're using the Kinvey _geoloc?
Yes, I use _geoloc as described in your doc.
Hey Kath, I found some documentation from mongo that deals with this topic. http://docs.mongodb.org/manual/reference/operator/query/box/
Hi Caroline,

thanks for your response, I saw this doc too but I don't know it explains what's going on. It just covers the general approach but doesn't answer my question.
I'm wondering if the StackOverflow community might have better ideas for how to approach it. Since it's not something Kinvey specific, I'm afraid it's not my forte, I'm sorry.
Login or Signup to post a comment