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)
polygon | geo-coordinates of polygon as lat/lng pairs (matrix) or object of class |
---|---|
res | resolution between 0 and 15 |
character vector of H3 indexes
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) %>% sf::st_transform(4326) h3_indexes <- polyfill(nc[1, ], res = 7)