create_grid_from_poly: Create ISEA-3-HEXAGON_grid_from_polygon

Description Usage Arguments Value Examples

View source: R/create_grid_from_poly.R

Description

Create ISEA-3-HEXAGON_grid_from_polygon

Usage

1
create_grid_from_poly(polygon_object, grid_res, set_seed = F)

Arguments

polygon_object

A sf polygon object

grid_res

The desired grid resolution for the hex grid

Value

A sf::sf object where each feature is a hexagon with a unique uuid, area [m2], and perimeter [m]

Examples

 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)}

Vizzuality/species-distribution-modelling documentation built on Oct. 31, 2019, 1:10 a.m.