[R-sig-Geo] Raster format and compression

Dutrieux, Loic loic.dutrieux at wur.nl
Thu Jan 22 15:05:40 CET 2015


Hello Maurizio,

Did you use the datatype = argument to specify the type (Signed/Unsigned Integer, float, etc)? If you don't writeRaster() will by default use "FLT8S", and there is a factor 4 difference in space between FLT8S and e.g. INT2S.
See for the list of options and what suits your data in the help of dataType (?dataType).

There are some additional compression options which can be passed to writeRaster() via the option = argument. For GeoTIFF you can find the list of options here -- http://www.gdal.org/frmt_gtiff.html

Cheers,
Loïc 
________________________________________
From: R-sig-Geo [r-sig-geo-bounces at r-project.org] on behalf of Maurizio Marchi [mauriziomarchi85 at gmail.com]
Sent: Thursday, January 22, 2015 2:40 PM
To: R-mailing list
Subject: [R-sig-Geo] Raster format and compression

Hello everybody.
I need help with writeRaster function of raster package. I downloaded
WorldClim rasters with 30 second of spatial resolution and I need to change
the projection from WGS84 to ETR89-LAEA. I used projectRaster function and
everything goes fine but when I write the raster map in .tif format, the
same of the input file, the result is much heavier than the first one
(approximately 200 MB versus 45 MB). Is there a particular option of
writeRaster function that I'm missing? Maybe the possibility to compress
the final raster? And which compression should be used?

Many thanks

--
Maurizio Marchi
Calenzano (FI) - Italy
ID Skype: maurizioxyz
Ubuntu 14.04 LTS
linux user 552742

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list