Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling geocoding in Firebase?

Has anyone tried storing and/or searching on geocodes (e.g. lat/long) in Firebase? This is functionality that is built into MongoDB and as I'm considering using Firebase for our backend instead, I need to know how I'd handle this scenario in Firebase.

Thanks!

like image 708
Patrick Sears Avatar asked Jan 18 '14 20:01

Patrick Sears


1 Answers

The folks at Firebase recently open-sourced a library that allows you to store and query location data in Firebase. In short, this is very easily accomplished because all keys in Firebase are strings, and Firebase has support for startAt() and endAt() queries that allow you to do the appropriate windowing for geohashes and bounding boxes.

For implementation details and usage, check out the live demos, source code, and their blog post on GeoFire.

like image 58
Rob DiMarco Avatar answered Sep 29 '22 22:09

Rob DiMarco