Get all hexagons with centers contained in a given polygon.

polyfill(polygon, res = 7)

# S3 method for matrix
polyfill(polygon, res = 7)

# S3 method for sfc
polyfill(polygon, res = 7)

# S3 method for sf
polyfill(polygon, res = 7)

Arguments

polygon

geo-coordinates of polygon as lat/lng pairs (matrix) or object of class sf or sfc

res

resolution between 0 and 15

Value

character vector of H3 indexes

Examples

nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) %>% sf::st_transform(4326) h3_indexes <- polyfill(nc[1, ], res = 7)