build_id_raster {mbg} | R Documentation |
Build ID raster
Description
Build an ID raster matching the extent of a vector dataset
Usage
build_id_raster(polygons, template_raster = NULL)
Arguments
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 |
Details
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.
Value
ID raster. A terra::SpatRaster object that minimally encloses the polygons
Examples
## Not run:
polygons <- sf::st_read(system.file('extdata/Benin_communes.gpkg', package = 'mbg'))
build_id_raster(polygons)
## End(Not run)
[Package mbg version 1.1.0 Index]