Skip to content
Snippets Groups Projects
Commit c6609e77 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Handle writing of no data flags as well

parent bb209a4d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment