Skip to contents

When a new terra::SpatRaster is created it is stored in memory. Writing it to disc and reading the object back from file requires two steps: terra::writeRaster then reading and re-assigning via terra::rast. writereadrast wraps these into a single step.

Usage

writereadrast(x, filename, overwrite = TRUE, layernames = NULL)

Arguments

x

A terra::SpatRaster

filename

A character file path and name to save x to disc.

overwrite

logical; overwrite existing raster. NB: by default, overwrite = TRUE, this is the opposite of the default behaviour of terra::writeRaster

layernames

character of length nlyr(x)

Value

A terra::SpatRaster object reading from disc at filename.

Examples