layer_mask {glossa} | R Documentation |
Apply Polygon Mask to Raster Layers
Description
This function crops and extends raster layers to a study area extent (bbox) defined by longitude and latitude then applies a mask based on a provided spatial polygon to remove areas outside the polygon.
Usage
layer_mask(layers, study_area)
Arguments
layers |
A stack of raster layers ('SpatRaster' object) to be processed. |
study_area |
A spatial polygon ('sf' object) used to mask the raster layers. |
Value
A 'SpatRaster' object representing the masked raster layers.
[Package glossa version 1.2.2 Index]