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