[R-sig-Geo] help unzipping tiff files compressed with gzip
Michael Sumner
mdsumner at gmail.com
Fri Jun 4 15:59:39 CEST 2010
gzfile gives a connection, which readGDAL does not support - you need
an actual dataset name that GDAL can understand (not necessarily just
a file path btw).
I think you will have to extract the tif with shell/system calls to
gzip or similar - what OS are you using? Rtools provides a handy gzip
that could be used if your system doesn't already have it (e.g.
Windows).
There are virtual drivers in GDAL for reading from compressed files
(similar to the R gzfile connection mechanism), but it will depend on
the installation of GDAL that you have with rgdal:
http://trac.osgeo.org/gdal/wiki/UserDocs/ReadInZip
http://osgeo-org.1803224.n2.nabble.com/Support-for-reading-GDAL-datasets-in-compressed-archives-gz-and-zip-td2035285.html
It's not available on my system as far as I know ( or I'm not using it
correctly) - if it were avaible in the GDAL used to build rgdal it
should allow readGDAL to read from the "/vsigzip/path....gz" string.
Cheers, Mike.
On Fri, Jun 4, 2010 at 10:40 PM, Alexandre VILLERS
<alexandre.villers at cebc.cnrs.fr> wrote:
> Good afternoon,
>
> I know this not the most appropriate place to post this message but I hope
> that some of you have already been confronted to the same problem.
> I have a lot of NDVI tiff files that have been compressed with gzip
> (filename such as 81jul15a.n07-VIg_data.tif.gz ) and that I need to
> geoprocess with R. I would like to unzip the tif from within R but was not
> able to properly understand how to connect to the gz file and unzip it with
> this with function gzfile.
> Anybody with some lines of codes hanging that would save my afternoon (and
> help me understand how the connection works) ?
>
> Best regards and thanks for any help.
>
> Alex
>
> --
> Alexandre Villers
> PhD.
> AgriPop
> Centre d'Etudes Biologiques de Chizé-CNRS UPR1934
> 79360 Beauvoir sur Niort
>
> Phone +33 (0)5 49 09 96 13
> Fax +33 (0)5 49 09 65 26
>
>
>
>
> __________ Information from ESET Mail Security, version of virus signature
> database 5171 (20100604) __________
>
> The message was checked by ESET Mail Security.
> http://www.eset.com
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
More information about the R-sig-Geo
mailing list