These functions permit moving between resolutions in the H3 grid system. The functions produce parent (coarser) or children (finer) cells.
H3Lib.H3Index Api.H3ToParent(H3Index h, int parentRes)
Returns the parent (coarser) index containing h.
Name | Type | Description |
---|---|---|
h | H3Lib.3Index | Cell to find the parent of |
parentRes | int | coarser resolution |
void Api.H3ToChildren(H3Index h, int childRes, out List<H3Index> outChildren)
Populates children with the indexes contained by h at resolution childRes. children must be an array of at least size maxH3ToChildrenSize(h, childRes).
Name | Type | Description |
---|---|---|
h | H3Lib.H3Index | Cell to find children of |
childRes | int | finer resolution |
outChildren | out List<H3Lib.H3Index> | child cells |
long Api.MaxH3ToChildrenSize(H3Index h, int childRes)
Returns the size of the array needed by h3ToChildren for these inputs.
Name | Type | Description |
---|---|---|
h | H3Lib.H3Index | Cell to find children of |
childRes | int | Resolution of children |
H3Lib.H3Index Api.H3ToCenterChild(H3Index h, int childRes)
Returns the center child (finer) index contained by h at resolution childRes.
Name | Type | Description |
---|---|---|
h | H3Lib.H3Index | Cell to find center child of |
childRes | int | finer resolution |
int Api.Compact(List<H3Index> h3Set, out List<H3Index> outCompacted)
Compacts the set h3Set of indexes as best as possible, into the List outCompacted.
Returns 0 on success.
Name | Type | Description |
---|---|---|
h3Set | List<H3Lib.H3Index> | Cells to compact |
outCompacted | out List<H3Lib.H3Index> | Compacted cells |
int Api.Uncompact(List<H3Index> compactedSet, out List<H3Index> outCells, int res)
Uncompacts the set compactedSet of indexes to the resolution res.
Returns 0 on success.
Name | Type | Description |
---|---|---|
compactedSet | List<H3Lib.H3Index> | Compacted cells |
outCells | out List<H3Lib.H3Index> | Uncompacted cells |
res | int | Resolution to uncompact to |
long Api.MaxUncompactSize(H3Index compacted, int r)
Returns the size of the array needed by uncompact.
Name | Type | Description |
---|---|---|
compacted | H3Lib.H3Index | Cell to uncompact |
r | int | Resolution to uncompact to |