From a37eb1ca00410a1ae19a02dbbb1fe93cd8e71ec0 Mon Sep 17 00:00:00 2001 From: Julien Osman <julien.osman@csgroup.eu> Date: Wed, 8 Jul 2020 09:10:27 +0200 Subject: [PATCH] BUG: Replace calls to GetMetadataValue by GetAs --- .../src/otbSentinel1ImageMetadataInterface.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx index d971d66bf3..433a0d40bc 100644 --- a/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx @@ -363,9 +363,9 @@ std::vector<OTB_azimuthFmRate> Sentinel1ImageMetadataInterface::GetAzimuthFmRate oss << listId; std::string path_root = "product.generalAnnotation.azimuthFmRateList.azimuthFmRate_" + oss.str(); OTB_azimuthFmRate afr; - std::istringstream(xmlMS.GetMetadataValue((path_root + ".azimuthTime").c_str())) >> afr.azimuthTime; + std::istringstream(xmlMS.GetAs<std::string>(path_root + ".azimuthTime")) >> afr.azimuthTime; afr.t0 = xmlMS.GetAs<double>((path_root + ".t0").c_str()); - afr.azimuthFmRatePolynomial = xmlMS.GetAsVector<double>((path_root + ".azimuthFmRatePolynomial").c_str(), + afr.azimuthFmRatePolynomial = xmlMS.GetAsVector<double>(path_root + ".azimuthFmRatePolynomial", ' ', xmlMS.GetAs<int>((path_root + ".azimuthFmRatePolynomial.count").c_str())); azimuthFmRateVector.push_back(afr); } @@ -383,7 +383,7 @@ std::vector<OTB_calibrationVector> Sentinel1ImageMetadataInterface::GetCalibrati oss << listId; std::string path_root = "calibration.calibrationVectorList.calibrationVector_" + oss.str(); OTB_calibrationVector calVect; - std::istringstream(xmlMS.GetMetadataValue((path_root + ".azimuthTime").c_str())) >> calVect.azimuthTime; + std::istringstream(xmlMS.GetAs<std::string>(path_root + ".azimuthTime")) >> calVect.azimuthTime; calVect.line = xmlMS.GetAs<int>((path_root + ".line").c_str()); calVect.pixel = xmlMS.GetAsVector<int>((path_root + ".pixel").c_str(), ' ', xmlMS.GetAs<int>((path_root + ".pixel.count").c_str())); @@ -445,8 +445,8 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds xmlMS = XMLMetadataSupplier(CalibrationFilePath); sarParam.absoluteCalibrationConstant = xmlMS.GetAs<double>("calibration.calibrationInformation.absoluteCalibrationConstant"); sarParam.calibrationVectors = this->GetCalibrationVector(xmlMS); - std::istringstream(xmlMS.GetMetadataValue("calibration.adsHeader.startTime")) >> sarParam.startTime; - std::istringstream(xmlMS.GetMetadataValue("calibration.adsHeader.stopTime")) >> sarParam.stopTime; + std::istringstream(xmlMS.GetAs<std::string>("calibration.adsHeader.startTime")) >> sarParam.startTime; + std::istringstream(xmlMS.GetAs<std::string>("calibration.adsHeader.stopTime")) >> sarParam.stopTime; } m_Imd.Bands[bandId].Add(MDGeom::SAR, sarParam); } -- GitLab