Commit 773167a3 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH: export/import sar calibration metadata in GDALImageIO

parent ba3d8ec2
Pipeline #8849 passed with stages
in 86 minutes and 53 seconds
......@@ -1909,6 +1909,12 @@ void GDALImageIO::ExportMetadata()
// be prefixed by: MDGeomNames[MDGeom::SensorGeometry] + '.'
ImageMetadataBase::Keywordlist kwl;
m_Imd.ToKeywordlist(kwl);
if (m_Imd.Has(MDGeom::SARCalib))
{
const auto & param = boost::any_cast<const otb::SARCalib&>(m_Imd[MDGeom::SARCalib]);
param.ToKeywordlist(kwl, "SARCalib.");
}
KeywordlistToMetadata(kwl);
int bIdx = 0;
......@@ -1952,6 +1958,20 @@ void GDALImageIO::ImportMetadata()
}
}
// Decode SAR metadata
if (kwl.find("SARCalib") != kwl.end())
{
try
{
otb::SARCalib sarCalib;
sarCalib.FromKeywordlist(kwl, "SARCalib.");
m_Imd.Add(MDGeom::SARCalib, sarCalib);
}
catch(const std::exception& e)
{
otbLogMacro(Warning, << "Input image has SAR calibration metadata, but OTB was not able to read it: " << e.what());
}
}
m_Imd.FromKeywordlist(kwl);
// Parsing the bands
......
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