Skip to contents

Crop, resample, and mask x against ref, and optionally replace any missing values.

Usage

match_ref(x, ref, missing_val = NULL, filename = NULL, overwrite = TRUE)

Arguments

x

SpatRaster object to bash into shape

ref

SpatRaster reference object

missing_val

If NULL missing value are left as is. Otherwise any NA or NaN values in x that are not NA in ref will be replaced by missing_val

filename

If not NULL output will be written to filename

overwrite

logical. If filename not NULL, then if TRUE, filename will be overwritten.

Value

SpatRaster of nlyrs(x) trimmed to extent and resolution of ref.

Examples

#placeholder example