[gdal-dev] hdf5image metadata problems

Alex Mantaut alexmantaut at suremptec.com.ar
Wed Jun 15 15:19:14 EDT 2011


Hi all,
        I'm trying to open the metadata from a subdataset of an HDF5 file...


        When I open the file by it's filename and then ask for the metadata
it returns the metadata asociated to the root and all the subdatasets....
But when I open the file by specifying the subdataset name to GDALOpen() and
then ask for the metadata it returns the metadata asociated to all groups
but none of the subdatasets...

        I looked a bit into the hdf5dataset code and realized that
this difference emerges from the fact that when GDAL opens the file
specifying only the filename it uses hdf5dataset to open the file, but when
I specify the subdataset to GDALOpen() it uses hdf5imagedataset instead, and
it loads the metadata in a different way.
        I'm not sure of what the expected behavior is on hdf5image for
loading metadata... It should load all the metadata of the file? Just the
metadata asociated to the subdataset? Or should the application ask for the
subdataset in some other way and then ask for the metadata?

       gdalinfo is returning the metadata asociated to the subdataset in
both cases, but it shows the data in the bands section... So I looked in to
the code of gdalinfo and it gets the information for the subdataset like
this:


GDALRasterBandH hBand;

hBand = GDALGetRasterBand( poDataset, 1);

char **allMetadata = GDALGetMetadata( hBand, NULL );
Must I use that in order to get the metadata?

Thanks in advance

-- 
--
     Alex Mantaut
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
alexmantaut at suremptec.com.ar
www.suremptec.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110615/dcbdf025/attachment.html


More information about the gdal-dev mailing list