[R-sig-Geo] Bug in brick() (raster package)?

Agustin Lobo alobolistas at gmail.com
Tue Feb 9 19:42:44 CET 2010


I might have found a bug in raster while trying to set the xlim for
my histograms taking into account whether input files are 8 or 16 bits.
In the following, note that GDALinfo reports one file as Byte and the
other one as UInt16, while brick() sets the same file at datanotation slot
for both files:

 > GDALinfo("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0373.tif")
CPL Warning 1: TIFFReadDirectory:Unknown field with tag 37717 (0x9355) encountered
rows        1760
columns     2640
bands       3
origin.x        0
origin.y        0
res.x       1
res.y       1
oblique.x   0
oblique.y   0
driver      GTiff
projection  NA
file        /media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0373.tif
apparent band summary:
   GDType Bmin Bmax
1   Byte    0  255
2   Byte    0  255
3   Byte    0  255
Metadata:
TIFFTAG_SOFTWARE=SIGMA PhotoPro 2.5.0.3250
TIFFTAG_DATETIME=2010:02:09 17:25:29
TIFFTAG_XRESOLUTION=180
TIFFTAG_YRESOLUTION=180
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Warning message:
In GDALinfo("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0373.tif") :
   GeoTransform values not available

 > r <- brick("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0373.tif")
CPL Warning 1: TIFFReadDirectory:Unknown field with tag 37717 (0x9355) encountered
Warning message:
In GDALinfo(filename) : GeoTransform values not available

 > r at file@datanotation
[1] "FLT4S"

 > GDALinfo("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0402.tif")
CPL Warning 1: TIFFReadDirectory:Unknown field with tag 37717 (0x9355) encountered
rows        3048
columns     4573
bands       3
origin.x        0
origin.y        0
res.x       1
res.y       1
oblique.x   0
oblique.y   0
driver      GTiff
projection  NA
file        /media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0402.tif
apparent band summary:
   GDType Bmin  Bmax
1 UInt16    0 65535
2 UInt16    0 65535
3 UInt16    0 65535
Metadata:
TIFFTAG_SOFTWARE=SIGMA PhotoPro 2.5.0.3250
TIFFTAG_DATETIME=2009:11:05 09:08:39
TIFFTAG_XRESOLUTION=180
TIFFTAG_YRESOLUTION=180
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Warning message:
In GDALinfo("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0402.tif") :
   GeoTransform values not available

 > r <- brick("/media/Transcend/MONTSENY2008/Montseny20090409/TiffOri/sdim0402.tif")
CPL Warning 1: TIFFReadDirectory:Unknown field with tag 37717 (0x9355) encountered
Warning message:
In GDALinfo(filename) : GeoTransform values not available

 > r at file@datanotation
[1] "FLT4S"

Hope this is useful

Agus



More information about the R-sig-Geo mailing list