firebase / geofire-js

GeoFire for JavaScript - Realtime location queries with Firebase
MIT License
1.45k stars 347 forks source link

Improve computation of geohashes inside a query's bounding box #19

Closed jwngr closed 10 years ago

jwngr commented 10 years ago

Within _listenForNewGeohashes(), we end up querying nine geohashes which encompass a GeoQuery. In cases where the query's radius is just greater than one of the values in g_BOUNDING_BOX_SHORTEST_EDGE_BY_GEOHASH_LENGTH, we end up loading a lot more data than we need to since most of the geohashes we are querying for are not even close to being in our query. We should use a smarter algorithm to compute a bounding box around a GeoQuery. This will probably involve doing more than nine geohash queries on geohashes of varying lengths.

jwngr commented 10 years ago

Fixed with pull request #22.