HDF dataset not openable with ImageFileReader
Mantis Issue 219, reported by cmoisy, assigned to msavinaud, created: 2011-01-06
ImageFileReader file existence test : l496 (otbImageFileReader.txx) // Test if the file exists. if (!itksys::SystemTools::FileExists(this->m_FileName.c_str()))
prevents HDF dataset to be read because the filename is not a filesystem name HDF4_EOS:EOS_GRID:"/home/chmoisy/MCD12Q1.A2008001.h13v11.005.2009338160210.hdf":MOD12Q1:Land_Cover_Type_1
if we try to open the HDF file, there is no bands, so we are blocked with otbGDALImageIO dataset->GetRasterCount() 0 value returned
can we use a GDALImageIO to be plugged with ImageFileReader so we can set the Filename of the Dataset directly ?
OTB v3.8
1294332258 - christopI've just added the support for hdf last week-end: http://hg.orfeo-toolbox.org/OTB/rev/5369ae0f2d44 http://hg.orfeo-toolbox.org/OTB/rev/cbdb47182fab
Can you try with the dev version? Use just the hdf as filename: /home/chmoisy/MCD12Q1.A2008001.h13v11.005.2009338160210.hdf and pass the dataset number using the SetDatasetNumber() method.
Let us know if you have any feedback, other suggestions for interface, etc. This could change until the next release if we find some more practical interface.
1294335709 - julienmWe planned to make an evolution on this, so that we can also read an hdf file by setting the filename followed by ":#dataset", like :
/home/chmoisy/MCD12Q1.A2008001.h13v11.005.2009338160210.hdf:0
to select the first dataset of MCD12Q1.A2008001.h13v11.005.2009338160210.hdf
This will allow all existing applications to work with hdf files without needing to change the code and add the SetDatasetNumber() call, and will save the specific GUI evolutions.
*12