
Use wrap
to pack a SpatVector or SpatRaster* to create a Packed* object. Packed objects can be passed over a connection that serializes (e.g. to nodes on a computer cluster). At the receiving end they need to be unpacked with unwrap
.
# S4 method for SpatRaster
wrap(x, proxy=FALSE)# S4 method for SpatRasterDataset
wrap(x, proxy=FALSE)
# S4 method for SpatRasterCollection
wrap(x, proxy=FALSE)
# S4 method for SpatVector
wrap(x)
# S4 method for ANY
unwrap(x)
wrap
: Packed* object
unwrap
: SpatVector, SpatRaster, SpatRasterCollection, SpatRasterDataset
SpatVector, SpatRaster, SpatRasterDataset or SpatRasterCollection
logical. If FALSE
raster cell values are forced to memory if possible. If TRUE
, a reference to source filenames is stored for data sources that are not in memory
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
p <- wrap(v)
p
vv <- vect(p)
vv
Run the code above in your browser using DataLab