From fb9ff48a5bfbb2d3770e78a8ae748b51807ddf1c Mon Sep 17 00:00:00 2001 From: Guillaume Pasero <guillaume.pasero@c-s.fr> Date: Thu, 18 Jan 2018 11:50:59 +0100 Subject: [PATCH] BUG: fix detection of Sentinel1 products --- .../OssimPlugins/src/ossim/ossimSentinel1Model.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp index e1136c0ce0..ccd6e68e4b 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp @@ -211,6 +211,8 @@ namespace ossimplugins // -----[ Read manifest file const ossimFilename safeFile = searchManifestFile(file); + ossimString sensorId; + ossimString imageId; if ( !safeFile.empty() ) { @@ -232,8 +234,8 @@ namespace ossimplugins ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "Manifest file " << safeFile << " opened\n"; } - theImageID = getImageId(manifestDoc); - if (theImageID.empty()) { + imageId = getImageId(manifestDoc); + if (imageId.empty()) { ossimNotify(ossimNotifyLevel_FATAL) << MODULE << "Image ID not found in manifest file " << safeFile << "\n"; return false; } @@ -243,8 +245,8 @@ namespace ossimplugins return false; } - theSensorID = initSensorID(manifestDoc); - if (theSensorID.empty()) { + sensorId = initSensorID(manifestDoc); + if (sensorId.empty()) { ossimNotify(ossimNotifyLevel_FATAL) << MODULE << "Cannot load sensor ID from " << safeFile << "\n"; return false; } @@ -313,6 +315,10 @@ namespace ossimplugins return false; } + // Fix sensor and image ID as they may be overriden during SensorModel::loadState() + theSensorID = sensorId; + theImageID = imageId; + theImageClipRect = ossimDrect( 0, 0, theImageSize.x-1, theImageSize.y-1 ); theSubImageOffset.x = 0.0; theSubImageOffset.y = 0.0; -- GitLab