[R-sig-Geo] GDAL Error - .grd not recognised as a supported file

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Aug 24 16:58:52 CEST 2009


On Mon, Aug 24, 2009 at 3:42 PM, Barry
Rowlingson<b.rowlingson at lancaster.ac.uk> wrote:

>  Since you are going to have trouble reading the whole dataset with
> readGDAL, it might be easier to use the low-level GDAL functions to
> sample from the whole thing. See help(GDAL.open) and
> help(getRasterData) for more info.
>

 This works for me:

> e=readGDAL("ETOPO1_Ice_g_gdal.grd",output.dim=c(100,100))
ETOPO1_Ice_g_gdal.grd has GDAL driver GMT
and has 10801 rows and 21601 columns

 So it must just be your GDAL not having drivers for these files.

 Note you can sub-sample in readGDAL, you don't need to go to the lower level.

 rgdal'  gdalDrivers() function should tell you what drivers your gdal
supports - I see this in mine:

28        GMT                                   GMT NetCDF Grid Format

 It's a single-band image and I don't think the colour palette is in there.

 Note you can sub-sample in readGDAL, you don't need to go to the
lower level, by doing output.dim=c(y,x).

Barry



More information about the R-sig-Geo mailing list