codec | R Documentation |
compress
reduces dimension of source image matrix and assigns indices. decompress
uses indices for expansion of reduced image matrix.
decompress(obj) compress(obj)
obj |
Object of class |
After masking, vectorization of lines, points and small polygons image matrix is often sparse.
Compressing (compress
) is an option to reduce object size in memory. Decompressing (decompress
) restore original data matrix.
Object of class ursaRaster
Currently, usage of compressed image matrix is limited. Spatial filtering (e.g. focal_mean
) does not operate with compressed data.
Nikita Platonov platonov@sevin.ru
session_grid(NULL) b <- as.data.frame(pixelsize()) b <- subset(b,x>1000000 & x<2000000 & y>3000000 & y<4000000) a1 <- as.ursa(b) print(a1) print(object.size(a1)) a2 <- compress(a1) print(a2) print(object.size(a2)) a3 <- decompress(a2) print(a3) print(object.size(a3)) print(identical(a1,a3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.