While after lossless compression with the libtiff command tiffcp it is only 8MB. To install libtiff on windows download and run the latest setup from http://gnuwin32.sourceforge.net/packages/tiff.htm. To compress a tiff file you need to run the following command (assuming that tiffcp is in your path). Make sure to specify a different output file name, otherwise the original will be overwritten with a broken and incomplete copy of the original.
tiffcp -c lzw uncompressed_input.tif compressed_output.tifIn R you can also write compressed raster (geo)tiff files by adding extra options to the writeRaster function from the raster package.
library(raster) x <- raster("uncompressed_input.tif") tifoptions <- c("COMPRESS=DEFLATE", "PREDICTOR=2", "ZLEVEL=6") writeRaster(x, "compressed_output.tif", options = tifoptions, overwrite = FALSE)
No comments:
Post a Comment