Description Usage Arguments Value Examples
View source: R/create_grid_from_poly.R
Create ISEA-3-HEXAGON_grid_from_polygon
1 | create_grid_from_poly(polygon_object, grid_res, set_seed = F)
|
polygon_object |
A sf polygon object |
grid_res |
The desired grid resolution for the hex grid |
A sf::sf object where each feature is a hexagon with a unique uuid, area [m2], and perimeter [m]
1 2 3 4 5 6 7 8 9 10 11 | bv <- create_biovar_stack(
region = 'biovar_Sweden',
biovar_list = c("biovar04", "biovar06", "biovar16"),
time_period = "biovar_historical",
path = "inst/ext_data/bioclimatic"
)
g <- create_grid_from_poly(bv$land_poly, grid_res=11, set_seed=999)
if(require(tmap)){
tmap_mode("view")
tm_shape(g)+ tm_fill("area_m2", palette = sf::sf.colors(3), alpha=0.7, colorNA=NULL,
legend.show = T)}else{plot(g)}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.