GDALDataset *gdalDataset = (GDALDataset*)GDALOpen("D:\\test.img", GA_ReadOnly);
if (NULL == InputFile)
{
// TODO
}
for (int iband = 1; iband < bandsize+1; iband++)
{
const char *wave = gdalDataset->GetRasterBand(iband)->GetMetadataItem("wavelength");
const char *waveUints = gdalDataset->GetRasterBand(iband)->GetMetadataItem("wavelength_uints");
if (nullptr == wave)
{
// TODO
}
if (nullptr == waveUints)
{
// TODO
}
}
提示:可以用来作为判断影像是否存在中心波长的方法。