Skip to contents

Prepare for fitting SDMs by reclassifying a landscape rasters according to the classifications used by a specific species distribution model (SDM).

Usage

reclassify_landcover(landscape_stack, SDM)

Arguments

landscape_stack

SpatRaster created by terra::rast()

SDM

The name of intended species distribution model: "riparian", "waterbird_fall", or "waterbird_win"

Value

SpatRaster with layers for each land cover class

Details

This function is called by python_focal_prep() on a set of landscape rasters generated by segregating an input landscape by class. It is not intended to be called directly.

Examples

#r <- terra::rast(matrix(sample(c(0:4), size = 100, replace = TRUE),
#         ncol = 10, nrow = 10)
#levels(r) <- c('RIPARIAN_FOREST_POFR', 'RIPARIAN_FOREST_QULO', 'WETLAND', 'ORCHARD', 'VINEYARD')
#layernames = terra::freq(r)$label
#s = terra::segregate(r, other = 0)
#names(s) = terra::freq(r)$label
#example = reclassify_landcover(s, SDM = 'RIPARIAN')