firebase / geofire-js

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

Add more bounding box dimensions to allow for longer geohashes #18

Closed jwngr closed 10 years ago

jwngr commented 10 years ago

This is related to pull request #15.

The geohash length stored in GeoFire is limited by the length of g_BOUNDING_BOX_SHORTEST_EDGE_BY_GEOHASH_LENGTH, which is currently 7. For small queries (less than 0.6 km), we still can only use a geohash of length 7 which means we end up loading a lot of locations which could be well outside of our query. We should increase the length of g_BOUNDING_BOX_SHORTEST_EDGE_BY_GEOHASH_LENGTH to 10, which should give us a precision of 1m and eliminate this unnecessary memory footprint.

jwngr commented 10 years ago

I believe the original values for g_BOUNDING_BOX_SHORTEST_EDGE_BY_GEOHASH_LENGTH were calculated via https://github.com/davidmoten/geo.

jwngr commented 10 years ago

This is no longer relevant after the perf improvements done in pull request #22.