[R-sig-Geo] readGDAL() and HDF5 files

Sebastian P. Luque spluque at gmail.com
Fri Jan 23 16:15:39 CET 2009


On Fri, 23 Jan 2009 11:01:21 +0100 (CET),
Roger Bivand <Roger.Bivand at nhh.no> wrote:

> On Fri, 16 Jan 2009, Sebastian P. Luque wrote:
>> Hi,

>> I'm trying to use HDF5 files with this structure:

> Sorry for the delay. Having now set up a reprodicable route (OSGeo4W
> GDAL and drivers, rgdal built against OSGeo4W as in a posting a couple
> of days ago), I can see the problem, but have no resolution.

> Doing gdalinfo on the data itself, I see geographical coordinates, not
> projected. GDAL does not retrieve the grid metadata correctly, and
> assigns default 1x1 grid cells starting at c(0.5, 0.5). Using
> gdal_translate to convert it to a GTiff, I see that I have to set p4s
> to NA to read at all, and the problems remain. I would be interested
> in knowing who or what wrote the HDF5 file, because it doesn't seem to
> be what it says it is (no grid metadata, different CRS from your
> assumption), and so the data may actually be in the wrong order too.

Thanks for looking into this Roger.  The data are distributed by the
OSI-SAF group (http://www.osi-saf.org).  I was able to work with the
data using the NetCDF files they distribute (for a subset of their data
for now), using NetCDF tools outside R.  However, I'd like to do it more
directly from R.

In the NetCDF files, longitude, latitude, and the data, are stored in
separate data subsets.  The grid is produced using the CRS specification
I provided (from OSI-SAF's documentation), however I cannot see where
the actual coordinates in that projection are in the files.  The
geographical coordinates are the inverse-projected coordinates of the
grid, hence not a regular grid.

I might ask in the GDAL list for more help.


Cheers,

-- 
Seb




More information about the R-sig-Geo mailing list