Skip to contents

This function allows you to create an H3 grid for a specific region.

This function is a wrapper of functions from the h3jsr package.

Usage

get_h3_grid(sf_object, resolution)

Arguments

sf_object

(character) An sf_object where to create the grid.

resolution

(numeric) The option for the resolution of image to download. Should between 1 and 16.

References

O'Brien L (2023). h3jsr: Access Uber's H3 Library. R package version 1.3.1, <https://CRAN.R-project.org/package=h3jsr>.

Examples


library(sf)

nc = st_read(system.file("shape/nc.shp", package="sf"))
#> Reading layer `nc' from data source 
#>   `/home/runner/work/_temp/Library/sf/shape/nc.shp' using driver `ESRI Shapefile'
#> Simple feature collection with 100 features and 14 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
#> Geodetic CRS:  NAD27

h3_grid_sf <- get_h3_grid(nc, resolution = 7)