Irrelon / ForerunnerDB

A JavaScript database with mongo-like query language, data-binding support, runs in browsers and hybrid mobile apps as a client-side DB or on the server via Node.js!
http://www.irrelon.com
721 stars 72 forks source link

GeoQueries Not Working as Expected With Large Data Sets #89

Closed Alexintosh closed 8 years ago

Alexintosh commented 8 years ago

It's my understanding that geo queries are a work in progress, although because I'd like to choose ForerunneDb for my next big project I wanted to ask where is it a stable version in the roadmap.

Thanks for the amazing work so far.

Irrelon commented 8 years ago

@Alexintosh Hey there, the geospatial queries do work and might be stable... I'm probably the only person who has used them though :)

It would be good to have some usage and feedback as they work for me but haven't been "battle tested" like the other main features of the engine since I've not received enough real-world feedback from others using them to make an informed decision about calling them stable or not.

Right now the only geospatial querying you have in ForerunnerDB is based on a centre point and distance radius. You can take a look at the doc here for more info: https://github.com/Irrelon/ForerunnerDB#near

If you have the time to test the functionality against your own data and provide some feedback that would be great :) - unlike the rest of the DB, geospatial queries is not in heavy use so I'm a little hesitant to say it's perfect - but it does pass unit testing :)

Irrelon commented 8 years ago

Closing as no further response.

Alexintosh commented 8 years ago

Sorry @Irrelon never really noticed the previous reply, I have a data set of around 500 point, the nearBy at list with my data is working poorly, I had to replace that logic by loading all the data set and filtering it with http://turfjs.org/.

A very weird behaviour I encountered is the following: I query for distance 5km and I actually get the points which are 5km away but I don't get of all those point with distance < 5km.

Irrelon commented 8 years ago

@Alexintosh Hmm that is weird as the unit tests are passing. However I will add some more data points and see. It might also be that you had the long lat the wrong way round for ForerunnerDB?

Alexintosh commented 8 years ago

Nope, I tried that. Also with turf the ordering is working as expected (so I assume it's not a data related issue).

Irrelon commented 8 years ago

@Alexintosh Are you able to share your data for testing purposes?

Alexintosh commented 8 years ago

Unfortunately not, but every bigger data set will give the same results. I tried with a couple of different database before opening the issue.

Irrelon commented 8 years ago

Ok thanks for the steer in the right direction, I will get some geo data and test with a few hundred at once :) 👍

Alexintosh commented 8 years ago

Thanks, really appreciate it. I'll open a different issue in few days regarding android + cordova once I confirm the problem and how to replicate it.

Irrelon commented 8 years ago

OK cool :)

Irrelon commented 8 years ago

Have confirmed the bug, believe it is something to do with calculating surround neighbour geohash blocks. Investigating further...

Irrelon commented 8 years ago

Hi ya,

I believe this issue is now resolved. I used a data set of 500 cities around the world and created a visual debugging tool with google maps to output the geospatial query results. Looking good!

Alexintosh commented 8 years ago

Thanks, I'll have a look and eventually confirm is fixed.