grid_from_region | R Documentation |
Divides the region of interest in a grid of a specific cell size.
grid_from_region(region, cell_size, complete_cover = TRUE)
region |
SpatVector object of a polygon for the region of interest. Object projection must be World Geodetic System (WGS84). |
cell_size |
(numeric) resolution for grid (single number or vector of two numbers) in kilometers (km). |
complete_cover |
(logical) whether or not to include cells of grid partially overlapped with region. Default = TRUE. |
Grid SpatVector for the region of interest. Each grid cell is related to a specific ID and longitude and latitude coordinates.
# Data
mx <- terra::vect(system.file("extdata/mx.gpkg", package = "biosurvey"))
# Create grid from polygon
grid_reg <- grid_from_region(region = mx, cell_size = 100)
terra::plot(grid_reg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.