-
Notifications
You must be signed in to change notification settings - Fork 37
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
getAtLocation doesn't work #37
Comments
I think the radius is in meters and not in Kilometers. So when I give larger values then it is matching and returning desired documents. |
But the doc says it's in km? I can't see what I should when assuming km either so I reckon this should be opened and is probably a doc issue |
I've given a rough look at the code and I think the error is that the radius is not converted from Km to m (internally it uses meters), so you're definitely right to reopen this issue and I'll mark this as a bug. |
I have confirmed that the library does indeed use meters although the documentation states kilometers. in GeoHashQuery.kt, the
Workaround: pass meters to the queries instead of kilometers. |
From initial testing i am sure it is not in KM, if you pass distance in KM then it calculates GEO hash for query upto 8 char, but if you pass distance in meters then it calculates GEO hash boundary box upto 5 char which make more sense |
I am not getting desired result when I pass a radius other than 0. When I pass the radius as 0 then I get all the documents returned.
Here is my code snippet in. Android using Java
GeoFirestore gfs = new GeoFirestore(cr)
gfs.getAtLocation(new GeoPoint(latitude, longitude), 0, new GeoFirestore.SingleGeoQueryDataEventCallback() {
@OverRide
public void onComplete(List<? extends DocumentSnapshot> list, Exception e) {
Log.d(TAG, "Documents matched:" + list.size()); // When radius is 0 then it returns all the documents otherwise it is empty list.
}
});
The text was updated successfully, but these errors were encountered: