| build_h3_maps | R Documentation |
Creates parent–child relationships among H3 planning units represented at multiple resolutions.
build_h3_maps(s_or_h3, res_vec = NULL, res_levels = NULL)
s_or_h3 |
An |
res_vec |
Optional integer vector of H3 resolutions. Required when
|
res_levels |
Optional integer vector of resolutions represented in the hierarchy. Defaults to the unique resolutions in the planning units. |
The supplied res or res_vec values are used directly and should match
the resolutions encoded by the corresponding H3 indexes.
A list with elements h3_vec, res_vec, res_levels,
row_idx_by_h3, nearest_parent_row_of, and children_by_row.
# Minimal example: two resolutions, parent-child relationship
h3_child <- "8a2a1072b59ffff" # example H3 index
h3_parent <- "892a1072b5bffff"
h3_vec <- c(h3_parent, h3_child)
h3_res <- h3jsr::get_res(h3_vec, simple = TRUE)
maps <- build_h3_maps(s_or_h3 = h3_vec, res_vec = h3_res)
str(maps, max.level = 1)
maps$nearest_parent_row_of
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.