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.
Arguments
- x
- filename
A
characterfile path and name to savexto disc.- overwrite
logical; overwrite existing raster. NB: by default,overwrite = TRUE, this is the opposite of the default behaviour ofterra::writeRaster- layernames
characterof lengthnlyr(x)
Value
A terra::SpatRaster object reading from disc at filename.