Skip to contents

This function returns the children of a particular H3 cell at the requested resolution.

Usage

get_children(h3_address = NULL, res = NULL, simple = TRUE)

Arguments

h3_address

Character; 15-character index generated by H3.

res

Integer; Desired H3 resolution. See https://h3geo.org/docs/core-library/restable/ for allowable values and related dimensions.

simple

Logical; whether to return a vector of outputs or a data frame containing both inputs and outputs.

Value

By default, a list of length(h3_address). Each list element contains a vector of H3 cell indexes.

Note

The number of cells returned for each request is 7 ^ (parent_res - child_res), so jumping three levels will return 343 indexes per request. This can cause memory issues with larger requests.

Examples

# What are the children of this resolution 6 cell index at resolution 8?
get_children(h3_address = '86be8d12fffffff', res = 8)
#> [[1]]
#>  [1] "88be8d1281fffff" "88be8d1283fffff" "88be8d1285fffff" "88be8d1287fffff"
#>  [5] "88be8d1289fffff" "88be8d128bfffff" "88be8d128dfffff" "88be8d1291fffff"
#>  [9] "88be8d1293fffff" "88be8d1295fffff" "88be8d1297fffff" "88be8d1299fffff"
#> [13] "88be8d129bfffff" "88be8d129dfffff" "88be8d12a1fffff" "88be8d12a3fffff"
#> [17] "88be8d12a5fffff" "88be8d12a7fffff" "88be8d12a9fffff" "88be8d12abfffff"
#> [21] "88be8d12adfffff" "88be8d12b1fffff" "88be8d12b3fffff" "88be8d12b5fffff"
#> [25] "88be8d12b7fffff" "88be8d12b9fffff" "88be8d12bbfffff" "88be8d12bdfffff"
#> [29] "88be8d12c1fffff" "88be8d12c3fffff" "88be8d12c5fffff" "88be8d12c7fffff"
#> [33] "88be8d12c9fffff" "88be8d12cbfffff" "88be8d12cdfffff" "88be8d12d1fffff"
#> [37] "88be8d12d3fffff" "88be8d12d5fffff" "88be8d12d7fffff" "88be8d12d9fffff"
#> [41] "88be8d12dbfffff" "88be8d12ddfffff" "88be8d12e1fffff" "88be8d12e3fffff"
#> [45] "88be8d12e5fffff" "88be8d12e7fffff" "88be8d12e9fffff" "88be8d12ebfffff"
#> [49] "88be8d12edfffff"
#>