-
Notifications
You must be signed in to change notification settings - Fork 79
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
How to replace firestore geofire with h3? #167
Comments
I would think the solution probably relies on the indexing order, however I need help with understanding how that is represented in the indexes between resolutions, if the lowest resolution set is continuous between |
I have read a few more responses from @nrabinowitz Stack Overflow as well and now I think I understand that the child indexes of any hexagon are not continuous alphanumerically, and cannot be used to range queries in NoSQL databases: Using the referenced h3 indexing order visualization I am able to extract that for the San Fransisco
To give more context, for now using the Geofire library I am mapping the h3 hexagons to their nearest geohash
Unfortunately this results in several parallel aggregate queries, and because the rectangles will never fit the hexagons, displaying aggregate numbers of the rectangles mapped to the hexagon will always be redundant and inaccurate. Of course I could just display the geohash rectangles on the map, but the benefits of h3 indexing are more appealing both visually and computationally. This is why I am looking for any solution where I can use h3 indexes in the database objects and query them at various resolutions in a way that are less expensive and less inaccurate relative to the current solution. |
If i understand your use case correctly, I believe H3 can do what you're trying to do. While k-rings (also called grid disks, the set of cells within |
Hello!
I am using the recommended Geofire library with the Firestore to save documents and query collections using Geohash:
https://firebase.google.com/docs/firestore/solutions/geoqueries
I have read through the issues of #100 and uber/h3#410 on using H3 with Firestore and the H3 Index structure but I still need your help with replacing the Geohash solution with H3 indexes.
I think my use case is simpler than the issues above, because I simply would like to save H3 indexes at resolution
9
on my documents, like thisand just run queries to get a collection of documents that are within a hexagon at various higher resolutions:
This way I can aggregate the document count with Firestore and display the number per hexagon on a map depending on the selected location and resolution.
Could you please help me understand how could I derive the correct
startAt
andendAt
values from a location and resolution to use them in aggregate Firestore queries?Thank you,
Mate
The text was updated successfully, but these errors were encountered: