View source: R/build_id_raster.R
build_id_raster | R Documentation |
Build an ID raster matching the extent of a vector dataset
build_id_raster(polygons, template_raster = NULL)
polygons |
terra::SpatVector object. The polygons to be aggregated to |
template_raster |
(optional) terra::SpatRaster object. The template raster should
contain and have the same CRS as the polygons. If template raster is |
The ID raster will be used to build the aggregation table. Each pixel has a unique integer value from 1 to the number of pixels in the ID raster.
ID raster. A terra::SpatRaster object that minimally encloses the polygons
## Not run:
polygons <- sf::st_read(system.file('extdata/Benin_communes.gpkg', package = 'mbg'))
build_id_raster(polygons)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.