wrapCache {terra} | R Documentation |
SpatRaster wrap with caching options
Description
Use wrap
to pack a SpatRaster with caching options. See wrap
for the general approach that is easier and better to use in most cases.
This method allows for specifying a folder, or filenames, to cache all sources of a SpatRaster in a specific location (on disk).
Usage
## S4 method for signature 'SpatRaster'
wrapCache(x, filename=NULL, path=NULL, overwrite=FALSE, ...)
Arguments
x |
SpatRaster |
filename |
character. A single filename, or one filename per SpatRaster data source. If not |
path |
character. If not |
overwrite |
Should existing files be overwritten when |
... |
Additional arguments for |
Value
PackedSpatRaster
See Also
Examples
f <- system.file("ex/elev.tif", package="terra")
r <- rast(f)
x <- wrapCache(r, path=tempdir())
x