What is the precision of Geofire query for distance?

702 views Asked by At

I can't find the precision of Geofire queries. I would appreciate it if someone could direct me to where I can find this.

I am looking for the minimum distance that I can do query on with Geofire.

Thanks,

1

There are 1 answers

0
Frank van Puffelen On BEST ANSWER

GeoFire encodes the latitude and longitude into a GeoHash value. The accuracy of a GeoHash value depends on the input data, the number of characters used to encode the location and the distance of the location from the equator.

It defaults to using 10 characters for the encoding, as you can see in the source code. This is (as far as I can tell) roughly accurate up to a meter.

But the library can handle encoding up to 22 characters in length if you invoke the constructor that takes a precision parameter.

Recommended reading: