[gdal-dev] Reading a HDF5 file with python (not recognised as a supported file format)

Rutger kassies at gmail.com
Tue May 1 07:18:16 EDT 2012


Dear list, 

Im trying to read an Aster HDF file in Python 2.7.2 on Windows 32bit. Im
using the latest Windows builds (gdal core+python bindings) from Tamas
Szekeres which dont come with the HDF4 driver. Therefore i converted it with
h4toh5convert (from the HDF Group) to a h5 file. 

When i use the default command line utilities all works well. Gdalinfo
nicely lists all metadata and subdatasets as expected and i can easily
convert them to for example geotiff with gdal_translate. So far so good....

However, when i try to load the h5 file in my python setup it fails to load.
The command:
gdal.open('filename.h5')

returns: ERROR 4: `filename.h5' not recognised as a supported file format.

directly accessing a subdataset like: 
gdal.open('HDF5:"filename.h5"://VNIR/VNIR_Swath/Data_Fields/ImageData1')

returns: ERROR 4:
`HDF5:filename.h5://VNIR/VNIR_Swath/Data_Fields/ImageData1' does not exist
in the file system and is not recognised as a supported dataset name.

I cant figure out why it works in the gdal command line utilities but not
with python. Working around it by first using gdal_translate to create a
geotiff and then opening the tiff with gdal.open() works fine, but i would
rather avoid yet another conversion.

Does anyone have any tips on how to debug this problem? Do i need to
(manually) point GDAL/Python to the HDF5 driver? Any help is appreciated.

Regards,
Rutger

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Reading-a-HDF5-file-with-python-not-recognised-as-a-supported-file-format-tp4943361.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list