Learn R Programming

h3jsr (version 1.3.1)

cells_to_multipolygon: Get geometry for a set of H3 cells

Description

This function returns geometry associated with a set of H3 cells, as a single sfc_MULTIPOLYGON.

Usage

cells_to_multipolygon(h3_addresses = NULL, simple = TRUE)

Value

By default, object of type sfc_MULTIPOLYGON of length 1.

Arguments

h3_addresses

Character vector or list of 15-character cell indices generated by H3.

simple

Logical; whether to return an sfc_MULTIPOLYGON or an sf object including the input cells.

Examples

Run this code
if (FALSE) {
# Give me the outline of the cells around Brisbane Town Hall at
# resolution 10 (not run as slow-ish)
bth <- sf::st_sfc(sf::st_point(c(153.023503, -27.468920)), crs = 4326)
bth_10 <- point_to_h3(bth, res = 10)
bth_patch <- get_disk(h3_address = bth_10, ring_size = 2)
bth_patch_sf <- cells_to_multipolygon(bth_patch)
}

Run the code above in your browser using DataLab