[gdal-dev] HDF5 metadata format problems

Alex Mantaut alexmantaut at suremptec.com.ar
Mon Jun 13 16:53:38 EDT 2011


Hi all:
        I've ran into some troubles while trying to interpret an HDF5's
metadata...

Every field on HDF5 has it's own type(string, uchar, double) But
GetMetadataItem("field_name")  converts the data from the dataset into a
C-style zero terminated string.

This gives me a few problems:

 a-This string has a trailing space for some datatypes, but not for others
(in unsigned char there is no space) ... There is no comment in the driver's
code explaining if this is necesary or not(hdf5dataset.cpp from line 661)...
I need to know if there will allways be a trailing space or not, to be able
to perform type conversion on the data...

b-Some items are type double and have more than 6 digits on the integer
part, but the string show the output in exponential notation, that makes me
lose some significant digits...

I looked into the code and the problems seems to be on hdf5dataset.cpp on
line 744, and changed the type on sprintf() from %g to %f, But now the
number of decimal digits is fixed, which could bring me similar problems
when using doubles... The question is: Is there a convention on how many
decimal digits you have to show on the string? there could be another way to
return a number from an item that doesn't truncate the digits?

Given all this problems i wonder: Could somebody provide a way to retrieve
the data in it's binary form with maybe some information on the metadata's
type? or this would only be usefull on the HDF5 format?

Sorry for the long mail

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
javierurien at suremptec.com.ar
www.suremptec.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110613/b16c3b01/attachment-0001.html


More information about the gdal-dev mailing list