wrap: wrap and unwrap

wrapR Documentation

wrap and unwrap

Description

Use wrap to pack a SpatRaster or SpatVector object 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.

Usage

## S4 method for signature 'SpatRaster'
wrap(x, proxy=FALSE)

## S4 method for signature 'SpatVector'
wrap(x)

## S4 method for signature 'ANY'
unwrap(x)

Arguments

x

SpatVector or SpatRaster

proxy

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

Value

wrap: Packed* object

unwrap: SpatRaster or SpatVector

Examples

f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
p <- wrap(v)
p
vv <- vect(p)
vv

terra documentation built on Jan. 17, 2023, 5:18 p.m.