firebase/geofire-js

Query base on GeoJsonLayer polygon

Closed this issue · 3 comments

How does GeoFire perform queries is it circular or rectangular in shape? Also is it possible to do query based on GeoJsonLayer polygon in Google Map where queries will be limited only inside of that polygon (city boundary). Thanks.

GeoFire searches for items within some radius, so it should be circular.

GeoFire searches for items within some radius, so it should be circular.

Yes since radius and diameter words are both use when talking about circle, but I just got confused when I read some thread that says rectangular so I wanted to correct myself if I am wrong of thinking that queries is in circular shape.

https://stackoverflow.com/a/42215681
#46 (comment)

puf commented

GeoFire uses geohashes to implement its functionality, and by their nature those allow querying in roughly rectangular areas. To implement the point+radius queries, GeoFire post-processes the keys it gets from the database to discard the ones outside of the requested radius.

The library has no support for any other shapes at the moment.