Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geofire querying data totally out of range for radius zero #265

Open
gutoamg opened this issue Apr 14, 2023 · 0 comments
Open

Geofire querying data totally out of range for radius zero #265

gutoamg opened this issue Apr 14, 2023 · 0 comments

Comments

@gutoamg
Copy link

gutoamg commented Apr 14, 2023

Version info

Firebase: V8 Modular (using cloud functions)

GeoFire: V6.0.0

Test case

If you try to query documents around [pointLatitude, pointLongitude] with radiusInM = 0 the query returns unexpected documents totally out of range(and not because of Geohashing approximations).

The radiusInM = 0 may happen if you're querying inside a loop, which is not so uncommon.

Steps to reproduce

Use geofire.geohashQueryBounds(center, radiusInM) as specified in the Firebase documentation for Firestore and assign radiusInM = 0.

Expected behavior

Would return the documents within the given radius around a center point [pointLatitude, pointLongitude].

Actual behavior

Returns many other documents completely out of range and may result in high costs depending on your application.
If you have documents around the given center but away from the radius, the query may still return them.

If I query for the same center but with a slightly bigger radius the query works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant