| marshal.RasterLayer | R Documentation |
Marshalling of 'raster' objects
## S3 method for class 'RasterLayer'
marshal(x, ...)
## S3 method for class 'RasterLayer'
marshallable(x, ...)
x |
A raster:RasterLayer object. |
... |
Not used. |
raster::writeRaster() is used to produce a marshalled version
of the original object.
raster::raster() is used to reconstruct a version of the
original object from the marshalled object.
A marshalled object as described in marshal().
Marshalling of RasterLayer objects is leaky. More precisely,
the method cannot guarantee that multiple rounds of marshalling
and unmarshalling produce numerically identical objects.
For further information, see (1).
Issue #311 - 'Incorrect large values saved to disk with writeRaster()', raster GitHub repostory, 2023-05-17, https://github.com/rspatial/raster/issues/311.
if (requireNamespace("raster", quietly = TRUE)) {
r <- raster::raster(system.file("external/test.grd", package = "raster"))
print(r)
## Marshal
r_ <- marshal(r)
## Unmarshal
r2 <- unmarshal(r_)
print(r2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.