-
Notifications
You must be signed in to change notification settings - Fork 43
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
radius isn't working perfectly #20
Comments
This happen because there is certain level of precision when you split the map into geohashes. More letters geohash contains more precision you get. The library is configured to support certain thresholds, you can find it here So, if you want to have better precision and actually not querying location from ~ 80km2 you need to lower the radius.
You should use 4.89 radius. |
How this table of radius working? how can i get items within 1km radius? |
You cannot have exact precision, geohashes doesn't work with circular radius. Used radius is taken to calculate closest precision that could be used to get as precise location set as it could be provided. Geogashes isn't perfect in it's nature, because you cannot have exact values for given range from the center point, unless you will have a high precision and plenty queries shifted by 3 rectangles in each sides until you get your desired results (opposite to calculating distance from lat, long and center point). This is works for firestore, because you don't need to read each document in the database to calculate the distance and return results, which will be too costly if your dataset is big enough. Geohashes allows you to use firestore within it limitations and have decent results. So, depends on the use case, you need to know how geogashes works and limitations of your database to pick proper solution @Nanaika |
i have 2 location wich difference is 37km
but in searching the query where radius is 5
the data is showing
The text was updated successfully, but these errors were encountered: