[R-sig-Geo] using readGDAL() for ESRI raster file

Roger Bivand Roger.Bivand at nhh.no
Thu Jun 1 08:44:43 CEST 2006


On Thu, 1 Jun 2006 karl.sommer at dpi.vic.gov.au wrote:

> Hello list
> 
> thanks to the helpful advice given by list members I have been able to read
> and re-project vector based shape files and attributes data using readOGR()
> under rgdal for further analysis (kriging, k-means clustering) and
> plotting.
> 
> Using the sp.layout under spplot allowed me to precisely overlay different
> data layers.
> 
> Yesterday  I was attempting to use the function readGDAL() to read an ESRI
> *.bil raster file of remote sensing spectral data.
> 
> Using GDALinfo under DOS within the data directory where the file is
> located gave me the following information
> 
> gdalinfo -nomd inputfile.bil
> 
> Driver: EHdr/ESRI .hdr Labelled
> Size is 813, 516
> Coordinate System is `'
> Origin = (617405.000000,6190325.500000)
> Pixel Size = (0.50000000,-0.50000000)
> Corner Coordinates:
> Upper Left  (  617405.000, 6190325.500)
> Lower Left  (  617405.000, 6190067.500)
> Upper Right (  617811.500, 6190325.500)
> Lower Right (  617811.500, 6190067.500)
> Center      (  617608.250, 6190196.500)
> Band 1 Block=813x1 Type=Int16, ColorInterp=Undefined
> Band 2 Block=813x1 Type=Int16, ColorInterp=Undefined
> Band 3 Block=813x1 Type=Int16, ColorInterp=Undefined
> Band 4 Block=813x1 Type=Int16, ColorInterp=Undefined
> Band 5 Block=813x1 Type=Int16, ColorInterp=Undefined
> Band 6 Block=813x1 Type=Int16, ColorInterp=Undefined
> 
> when I am trying to read the same file using readGDAL() in R I get the
> following error and so far have not been able to make sense of it.
> 
> test <- readGDAL("inputfile.bil", package="gdal")

                                     ^^^^^^^

The smoking gun is the error message, the "..." argument is used for 
passinf valid arguments throught to getRasterData(), etc. getRasterData() 
does not have a package= argument, so I expect that if you remove it, this 
problem should go away.

Roger

> inputfile.bil has GDAL driver EHdr
> and has 516 rows and 813 columns
> Error in getRasterData(x, offset = offset, region.dim = region.dim, ...) :
>       unused argument(s) (package ...)
> 
> Any pointers would be gratefully accepted
> 
> Regards
> 
> Karl J Sommer
> Scientist
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list