This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 271
Should GeoHashQuery include endValue or not? #155
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I noticed the same outliers in my own testing with geohashes/geoqueries based on GeoFire, although never as bad as the |
@puf thanks for the info. If we hit the But if there are cases with no outliers where the resulting |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello! Thanks for nice library.
I have a question about the following methods from
GeoHashQuery.java
:I don't fully understand this code, but I have an impression that
endValue
fromqueryForGeoHash
is not supposed to be included into the query. I mean that the query should be interpreted asstartValue <= geohash < endValue
but in fact when the query is executed it's inclusive:startValue <= geohash <= endValue
.To fix that we could change the line:
into:
To illustrate this, look at my results with center in Caracas, Venezuela and radius=350km (the selected area is what's included into the query):
Note: actually I'm using a kotlin version of the code from here: https://github.com/imperiumlabs/GeoFirestore-Android/blob/34b935c534c583520a706c3388c57962122846bf/geofirestore/src/main/java/org/imperiumlabs/geofirestore/core/GeoHashQuery.kt
but the logic is exactly the same, so I think that the code in this repo is (or is closer to) the original.
The text was updated successfully, but these errors were encountered: