[R-sig-Geo] Problem reading files through rgdal

Rainer M Krug r.m.krug at gmail.com
Tue Dec 13 10:58:57 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/12/11 10:46, Agustin Lobo wrote:
> More details: the problem occurs with tif files only, therefore it 
> seems that the warning message points to the actual problem.
> Unfortunately, I'm not skilled to go beyond this and really do not
> know what to do.

You could install the gdal version on the Ubuntu repository - that one
works. Just remember to lock this version in synaptic.

Cheers,

Rainer

> 
>> GDALinfo("/media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/ilerfly/125-6b-111010b.tif")
>
>> 
Error in .local(.Object, ...) :
> WARNING ! libtiff version mismatch : You're linking against
> libtiff 3.X but GDAL has been compiled against libtiff >= 4.0.0
> 
>> GDALinfo("/media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/ilerfly/algerri_goomercator.bmp")
>
>> 
rows        532
> columns     1093 bands       3 origin.x        71725.2 origin.y
> 5130101 res.x       0.5965674 res.y       0.5965674 ysign       -1 
> oblique.x   0 oblique.y   0 driver      BMP projection  NA file
> /media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/ilerfly/algerri_goomercator.bmp
>
> 
apparent band summary:
> GDType Bmin Bmax     Bmean      Bsd hasNoDataValue NoDataValue 1
> Byte    0  255 122.93389 57.72138          FALSE           0 2
> Byte    0  255 117.77019 48.26621          FALSE           0 3
> Byte    0  255  83.67153 45.79935          FALSE           0
>> GDALinfo("/media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/ilerfly/125-6b-111010b.tif")
>
>> 
Error in .local(.Object, ...) :
> `/media/Iomega_HDD/UAVetal/CALIBRACIONRADIOM/TETRACAM6/FISIOV_UB/ALGERRI/ilerfly/125-6b-111010b.tif'
>
> 
not recognised as a supported file format.
> 
> 
> Agus
> 
> 2011/12/13 Agustin Lobo <alobolistas at gmail.com>:
>> Just adding more details: gdalinfo works fine on the same file
>> for which infoGDAL() fails:
>> 
>> Also, after reinstalling rgdal from cran, I get a warning:
>>> GDALinfo(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep=""))
>>
>>> 
Error in .local(.Object, ...) :
>> WARNING ! libtiff version mismatch : You're linking against
>> libtiff 3.X but GDAL has been compiled against libtiff >= 4.0.0
>>> system("gdalinfo
>>> /media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tif",intern=T)
>>
>>> 
[1] "Driver: GTiff/GeoTIFF"
>> [2] "Files:
>> /media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tif"
>>
>> 
[3] "
/media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tfw"
>> [4] "
>> /media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tif.aux.xml"
>>
>> 
[5] "Size is 2221, 1950"
>> [6] "Coordinate System is:" [7] "PROJCS[\"ED50 / UTM zone
>> 31N\"," [8] "    GEOGCS[\"ED50\"," [9] "
>> DATUM[\"European_Datum_1950\"," [10] "
>> SPHEROID[\"International 1924\",6378388,297.0000000000014," [11]
>> "                AUTHORITY[\"EPSG\",\"7022\"]]," [12] "
>> AUTHORITY[\"EPSG\",\"6230\"]]," [13] "
>> PRIMEM[\"Greenwich\",0]," [14] "
>> UNIT[\"degree\",0.0174532925199433]," [15] "
>> AUTHORITY[\"EPSG\",\"4230\"]]," [16] "
>> PROJECTION[\"Transverse_Mercator\"]," [17] "
>> PARAMETER[\"latitude_of_origin\",0]," [18] "
>> PARAMETER[\"central_meridian\",3]," [19] "
>> PARAMETER[\"scale_factor\",0.9996]," [20] "
>> PARAMETER[\"false_easting\",500000]," [21] "
>> PARAMETER[\"false_northing\",0]," [22] "    UNIT[\"metre\",1," 
>> [23] "        AUTHORITY[\"EPSG\",\"9001\"]]," [24] "
>> AUTHORITY[\"EPSG\",\"23031\"]]" [25] "Origin =
>> (404629.090000000025611,4624285.299999999813735)" [26] "Pixel
>> Size = (10.000000000000000,-10.000000000000000)" [27]
>> "Metadata:" [28] "  TIFFTAG_XRESOLUTION=300" [29] "
>> TIFFTAG_YRESOLUTION=300" [30] "  TIFFTAG_RESOLUTIONUNIT=2
>> (pixels/inch)" [31] "  AREA_OR_POINT=Area" [32] "Image Structure
>> Metadata:" [33] "  INTERLEAVE=PIXEL" [34] "Corner Coordinates:" 
>> [35] "Upper Left  (  404629.090, 4624285.300) (  1d51' 9.77\"E, 
>> 41d45'50.20\"N)" [36] "Lower Left  (  404629.090, 4604785.300) (
>> 1d51'20.98\"E, 41d35'18.04\"N)" [37] "Upper Right (  426839.090,
>> 4624285.300) (  2d 7'11.49\"E, 41d45'58.68\"N)" [38] "Lower Right
>> (  426839.090, 4604785.300) (  2d 7'20.10\"E, 41d35'26.47\"N)" 
>> [39] "Center      (  415734.090, 4614535.300) (  1d59'15.58\"E, 
>> 41d40'38.63\"N)" [40] "Band 1 Block=2221x16 Type=Byte,
>> ColorInterp=Gray" [41] "Band 2 Block=2221x16 Type=Byte,
>> ColorInterp=Undefined" [42] "Band 3 Block=2221x16 Type=Byte,
>> ColorInterp=Undefined" [43] "Band 4 Block=2221x16 Type=Byte,
>> ColorInterp=Undefined"
>> 
>> 
>> 
>> Agus
>> 
>> 
>> 2011/12/13 Agustin Lobo <alobolistas at gmail.com>:
>>> Hi!
>>> 
>>> I have this problem and think it's related to rgdal (or rather
>>> to gdal).
>>> 
>>> r <- raster(ncol=10, nrow=10) r1 <- init(r, fun=runif) r2 <-
>>> init(r, fun=runif) r3 <- overlay(r1, r2,
>>> fun=function(x,y){return(x+y)})
>>>> writeRaster(r3,filename="delme.tif",format="GTiff",overwrite=T,datatype="FLT4S")
>>>
>>>> 
Error in .local(.Object, ...) : Unable to create dataset
>>>> sp2003 <-
>>>> brick(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep=""))
>>>
>>>> 
Error in .rasterObjectFromFile(x, objecttype = "RasterBrick", ...) :
>>> Cannot create a RasterLayer object from this file.
>>>> delme =
>>>> readGDAL(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep=""))
>>>
>>>> 
Error in .local(.Object, ...) :
>>> 
>>> `/media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tif'
>>>
>>> 
not recognised as a supported file format.
>>> 
>>>> GDALinfo(paste(datawd,"/SPOTmultispectral/SP2003ATC_atm2.tif",sep=""))
>>>
>>>> 
Error in .local(.Object, ...) :
>>> 
>>> `/media/Iomega_HDD/MASTER_ICTA2007_2008/ExercisesJEMES/ExerciseFIRESPOT/Data_ExerciseFIRESPOT/SPOTmultispectral/SP2003ATC_atm2.tif'
>>>
>>> 
not recognised as a supported file format.
>>> 
>>> I can read/write any external file not using rgdal, and save()
>>> and save.image() work fine:
>>>> save.image() x = data.frame(var1=1:10,var2=LETTERS[1:10]) x
>>> var1 var2 1     1    A 2     2    B 3     3    C 4     4    D 5
>>> 5    E 6     6    F 7     7    G 8     8    H 9     9    I 10
>>> 10    J
>>>> write.csv(x,file="x.csv") x2 <- read.csv("x.csv") x2
>>> X var1 var2 1   1    1    A 2   2    2    B 3   3    3    C 4
>>> 4    4    D 5   5    5    E 6   6    6    F 7   7    7    G 8
>>> 8    8    H 9   9    9    I 10 10   10    J
>>> 
>>> It seems to me a problem with gdal, my version is 1.8.0.2 from 
>>> ubuntugis-unstable binaries for ubuntu 10.04 Are you aware of
>>> any problem with gdal and/or rgdal?
>>> 
>>> Thanks,
>>> 
>>> Agus
>>> 
>>>> sessionInfo()
>>> R version 2.14.0 (2011-10-31) Platform: x86_64-pc-linux-gnu
>>> (64-bit)
>>> 
>>> locale: [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>>> LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
>>> LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>>> LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C
>>> LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>>> 
>>> attached base packages: [1] stats     graphics  grDevices utils
>>> datasets  methods   base
>>> 
>>> other attached packages: [1] rgdal_0.7-5   raster_1.9-55
>>> sp_0.9-89
>>> 
>>> loaded via a namespace (and not attached): [1] grid_2.14.0
>>> lattice_0.19-30 tools_2.14.0
> 
> _______________________________________________ R-sig-Geo mailing
> list R-sig-Geo at r-project.org 
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7nIeAACgkQoYgNqgF2egrK0wCbBzu8r+j3/5H18mM3r6hSlUux
8n0AoIEz0Ii/TGqlUGg/LUNdUf60lrMg
=ysHN
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list