Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could I query Firebase geo locations without GeoFire in order to return results based on distance between two points?

Firebase just updated their sdk to 3.x and the current version of GeoFire 2.x doesn't work.

What I would like to know is the best way to store geo location values so that I can query firebase so that we only return location with in a defined radius around the user.

Example: user defines that they would like all items that are within 20 miles or less from them.

I wonder if I could store a single value from the latitude and longitude that would allow me to quickly query for this data? Or maybe that isn't the right approach ?

like image 814
mattwallace Avatar asked May 22 '16 14:05

mattwallace


1 Answers

It is not possible using pure firebase without implementing some sort of geohash (it is what geofire does). You could use an externa index stored in elastic search or in redis for example

like image 55
Seb Avatar answered Oct 06 '22 00:10

Seb