Learn R Programming

glossa (version 1.0.0)

layer_mask: 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)

Value

A `SpatRaster` object representing the masked raster layers.

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.