Skip to contents

This function simply extracts the values from a provided SpatRaster, SpatRasterDataset or SpatRasterCollection object. For points where or NA values were extracted a small buffer is applied to try and obtain the remaining values.

Usage

get_rastervalue(coords, env, ngb_fill = TRUE, rm.na = FALSE)

Arguments

coords

A data.frame, matrix or sf object.

env

A SpatRaster object with the provided predictors.

ngb_fill

logical on whether cells should be interpolated from neighbouring values.

rm.na

logical parameter which - if set - removes all rows with a missing data point (NA) from the result.

Value

A data.frame with the extracted covariate data from each provided data point.

Details

It is essentially a wrapper for terra::extract.

Examples

if (FALSE) {
# Extract values
vals <- get_rastervalue(coords, env)
}