Reading files containing several images (Modis HDF, Alos polarimetric data)
Mantis Issue 20, reported by echristophe, assigned to msavinaud, created: 2008-11-07
OTB can't read Modis HDF product.
This format is readable by gdal. The problem is that it contains several subproduct (SUBDATASETS). The assumption implicitly made by the reader that 1 file= 1 otb::Image is wrong in this case.
It would be useful to be able to template the reader on otb::ObjectList<otb::Image<tbd,2> > for example.
A request such as papszMetadata = m_poDataset->GetMetadata("SUBDATASETS"); enable to get a list of subsets: {'SUBDATASET_2_NAME': 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf": 1', 'SUBDATASET_5_NAME': 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf": 4', 'SUBDATASET_1_DESC': '[8000x8000] EV_500_RefSB_b0 (16-bit unsigned integer)', 'SUBDATASET_1_NAME': 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf":0', 'SUBDATASET_4_DESC': '[8000x8000] EV_500_RefSB_b3 (16-bit unsigned integer)', 'SUBDATASET_4_NAME': 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf":3', 'SUBDATASET_5_DESC': '[8000x8000] EV_500_RefSB_b4 (16-bit unsigned integer)', 'SUBDATASET_3_NAME': 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf":2', 'SUBDATASET_2_DESC': '[8000x8000] EV_500_RefSB_b1 (16-bit unsigned integer)', 'SUBDATASET_3_DESC': '[8000x8000] EV_500_RefSB_b2 (16-bit unsigned integer)'} for example.
Passing a name corresponding to the subset to gdal (eg: 'HDF4_SDS:UNKNOWN:"AM20080501_500m_bands.hdf":1') will enable it to read the product.
1232420773 - christopThe same problem occurs for Also polarimetric data. The same VOL-ALPSRPXXXXXXXXX-H1.1__A file should open two: IMG-HH-ALPSRPXXXXXXXXX-H1.1__A IMG-HV-ALPSRPXXXXXXXXX-H1.1__A
Only one is opened (don't know which one). At a gdal level, everything seems correct.
1232440134 - christopCorrection: For Alos/Palsar polarimetric product, using: typedef std::complex PixelType; typedef otb::VectorImage<PixelType,2> ImageType; seems to be able to read the data.
1266767206 - whatnickThe JAXA-PALSAR CEOS driver was written by me and is maitained by philv. You should contact him for updates. The data is read as however many complex channels can be identified. Using vector images solves this, the data is actually not subdatasets, but vectorimages with same dimensions. Have you tried Cosmo HDF files ? This will be great addition. I will run a test with some we have if you make a reader implementation/mosaicing system with the subdatasets.
1303391276 - mickaelThis prob