Commit c6609e77 authored by Julien Michel's avatar Julien Michel

ENH: Handle writing of no data flags as well

parent bb209a4d
......@@ -1758,8 +1758,22 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
otbMsgDevMacro( << "GCP Count: " << dataset->GetGCPCount() );
// Write no-data flags
std::vector<bool> noDataValueAvailable;
bool ret = itk::ExposeMetaData<std::vector<bool> >(dict,MetaDataKey::NoDataValueAvailable,noDataValueAvailable);
std::vector<double> noDataValues;
itk::ExposeMetaData<std::vector<double> >(dict,MetaDataKey::NoDataValue,noDataValues);
if(ret)
{
for (int iBand = 0; iBand < dataset->GetRasterCount(); iBand++)
{
if(noDataValueAvailable[iBand])
{
dataset->GetRasterBand(iBand+1)->SetNoDataValue(noDataValues[iBand]);
}
}
}
}
std::string GDALImageIO::FilenameToGdalDriverShortName(const std::string& name) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment