-
Notifications
You must be signed in to change notification settings - Fork 78
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
h3js index find all children using index values #122
Comments
So the following snippet ought to work: function isChildOf(possibleParent, possibleChild) {
return possibleParent === h3.h3ToParent(possibleChild, h3.h3GetResolution(possibleParent));
} Since the parent-child relationship is a simple tree structure in H3, there can be only one parent for any H3 index at any given resolution coarser (smaller) than its own resolution. |
Oh, and the second piece "find a range of indexes that are all children of a specified id" is just |
@dfellis thanks for the reply. But since we don't have access to the h3 library in the database is there any equations or logic to calculate the output of |
So, yes, the underlying C implementation of
|
@dfellis Thanks, I am looking into the functions. it seems they are the exact functions I am looking for |
Hello,
Suppose we are storing h3 indexes in a database column. To perform a parent/child query I was thinking of using h3 indexes. Lets say we have this index
832834fffffffff
. This cell's children are[ '8428341ffffffff', '8428343ffffffff', '8428345ffffffff', '8428347ffffffff', '8428349ffffffff', '842834bffffffff', '842834dffffffff']
. What is the logic to tell if an h3index id is a child of another id. Is there any way that we can find a range of indexies that are child of the specific id.I already found uber/h3#320 and https://stackoverflow.com/questions/53911322/is-the-h3index-ordered but could not find my answer.
Thanks
The text was updated successfully, but these errors were encountered: