-
Notifications
You must be signed in to change notification settings - Fork 97
Description
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 this
setDoc(doc(db, 'stores'), { h3: '8965812cb23ffff' });
and just run queries to get a collection of documents that are within a hexagon at various higher resolutions:
db.collection('stores').orderBy('h3').startAt('8365aafffffffff').endAt('?');
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 and endAt values from a location and resolution to use them in aggregate Firestore queries?
Thank you,
Mate


