Skip to contents

This function extracts values from a raster mosaic based on the regions defined in a shapefile using exactextractr::exact_extract().

Usage

mosaic_extract(mosaic, shapefile, fun = "median", ...)

Arguments

mosaic

A SpatRaster object representing the raster mosaic from which values will be extracted.

shapefile

A shapefile, which can be a SpatVector or an sf object, defining the regions of interest for extraction.

fun

A character string specifying the summary function to be used for extraction. Default is "median".

...

Additional arguments to be passed to exactextractr::exact_extract().

Value

A data frame containing the extracted values for each region defined in the shapefile.