Commit c4acc81a authored by Julien Osman's avatar Julien Osman
Browse files

ENH: Avoid reading and writing AREA_OR_POINT twice

parent 625ea8fa
Pipeline #8871 failed with stages
in 94 minutes and 34 seconds
......@@ -1125,12 +1125,6 @@ void GDALImageIO::InternalReadImageInformation()
itk::EncapsulateMetaData<MetaDataKey::BoolVectorType>(dict, MetaDataKey::NoDataValueAvailable, isNoDataAvailable);
itk::EncapsulateMetaData<MetaDataKey::VectorType>(dict, MetaDataKey::NoDataValue, noDataValues);
}
// Read AREA_OR_POINT value if present
papszMetadata = dataset->GetMetadata(nullptr);
auto areaOrPoint = CSLFetchNameValue(papszMetadata, "AREA_OR_POINT");
if (areaOrPoint)
m_Imd.Add(MDStr::AreaOrPoint, areaOrPoint);
}
bool GDALImageIO::CanWriteFile(const char* name)
......@@ -1632,16 +1626,6 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
{
dataset->GetRasterBand(noData.first)->SetNoDataValue(noData.second);
}
/* -------------------------------------------------------------------- */
/* AREA_OR_POINT */
/* -------------------------------------------------------------------- */
// Write AREA_OR_POINT flag from ImageMetadata
if (m_Imd.Has(MDStr::AreaOrPoint))
{
dataset->SetMetadataItem("AREA_OR_POINT", m_Imd[MDStr::AreaOrPoint].c_str());
}
}
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