[R-sig-Geo] subdatasets in rgdal/raster

Michael Sumner mdsumner at gmail.com
Wed Oct 15 06:20:51 CEST 2014


Hello,

As far as I know there's nothing in rgdal to determine existing
subdatasets (SDS) in HDF (or NetCDF for that matter).

In raster, raster(x) will read from the first candidate *variable*,
and list the others with a warning, which is analogous to an SDS but
of course it's always providing this via ncdf/ncdf4 rather than via
rgdal.

Is it true there's no way to find out SDS from HDF or NetCDF in rgdal?

I've not really explored this before much since compiling HDF was
unavailable to me. gdalUtils fills a gap but only by running the
installed command line tools, which obviously can be avoided with the
right features in rgdal/raster. I personally have always run the
command line tools and then jumped back to R (if I could).

(The vector analogy in rgdal to listing SDS would be ogrListLayers).

This is a missing capability in the raster package, somewhat disguised
because of the independent support for NetCDF. I guess hardly anyone
is using HDF? That's a shame since these R tools really help.  It's a
pretty complicated story all round and I keep re/discovering
interesting corners. If anyone is writing anything significant about
all this I'd be keen to be involved.

Cheers, Mike.

-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list