[gdal-dev] error parsing metadata from HDF5 dataset
Even Rouault
even.rouault at spatialys.com
Thu Sep 3 08:13:11 PDT 2015
Le jeudi 03 septembre 2015 16:58:34, Rashad M a écrit :
> Hello all,
>
> I have an problem when reading metadata information of HDF5 dataset. some
> of the values are not parsed properly by GDAL. Below is the relevant part
> of output from gdalinfo
>
>
> ....
> Azimuth_Processing_Number_of_Looks=
> Bits_per_Sample=
> ....
>
> S01_B001_Azimuth_Ramp_Code=
>
> <garbage values and newline chars>
>
> ....
> ....
> Sample_Format=INT
> Samples_per_Pixel=
> Satellite_Height=628440.5
> Satellite_ID=CSKS3
> ....
>
>
> I had looked into frmts/hdf5/hdf5dataset.cpp and all of these metadata are
> of type H5T_NATIVE_UCHAR.
>
> https://trac.osgeo.org/gdal/browser/branches/1.11/gdal/frmts/hdf5/hdf5datas
> et.cpp#L728
>
> changing format specifier from char( %c) to int(%d) solves the issue for
> me. But is there a better fix for this?
That looks like a reasonable fix. And the cast should be a (unsigned char*).
%c should be used only for characters part of a string, but the string case is
dealt before, so that must mean that those should be dealt as integer values.
The _CHAR and _SCHAR above are also likely wrong.
Could you raise a ticket about that in Trac ?
>
>
> OS: Fedora 20 x86_64
> gdal branch: 1.11
>
> svn info
>
> Path: .
> Working Copy Root Path: /home/mkanavat/sources/gdal_branch_1.11
> URL: http://svn.osgeo.org/gdal/branches/1.11/gdal
> Relative URL: ^/branches/1.11/gdal
> Repository Root: http://svn.osgeo.org/gdal
> Repository UUID: f0d54148-0727-0410-94bb-9a71ac55c965
> Revision: 30007
> Node Kind: directory
> Schedule: normal
> Last Changed Author: rouault
> Last Changed Rev: 30005
> Last Changed Date: 2015-09-01 10:17:50 +0200 (Tue, 01 Sep 2015)
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list