Commit 162212ae authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO

BUG : Correction into ossimSarSensorModel to get/read new elements only if header version >= 3

parent 010590c6
......@@ -456,6 +456,7 @@ protected:
static const double C;
static const unsigned int thePluginVersion; // version of the SarSensorModel plugin
static const unsigned int thePluginVersionMin; // minimal version required of the SarSensorModel plugin
private:
/** Disabled assignment operator. */
......
......@@ -107,7 +107,8 @@ namespace ossimplugins
const double ossimSarSensorModel::C = 299792458;
const unsigned int ossimSarSensorModel::thePluginVersion = 2;
const unsigned int ossimSarSensorModel::thePluginVersion = 3;
const unsigned int ossimSarSensorModel::thePluginVersionMin = 2;
ossimSarSensorModel::ProductType::ProductType(string_view const& s)
{
......@@ -1166,9 +1167,22 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
ossimSarSensorModel::BurstRecordType burstRecord;
get(kwl, burstPrefix + keyStartLine, burstRecord.startLine);
get(kwl, burstPrefix + keyEndLine, burstRecord.endLine);
get(kwl, burstPrefix + keyStartSample, burstRecord.startSample);
get(kwl, burstPrefix + keyEndSample, burstRecord.endSample);
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
// startSample and endSample since version 3
if (version >= 3)
{
get(kwl, burstPrefix + keyStartSample, burstRecord.startSample);
get(kwl, burstPrefix + keyEndSample, burstRecord.endSample);
}
}
catch (...) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
get(kwl, burstPrefix + keyAzimuthStopTime, burstRecord.azimuthStopTime);
burstRecords.push_back(burstRecord);
}
......@@ -1393,7 +1407,7 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
if (version < thePluginVersion) {
if (version < thePluginVersionMin) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
} catch (...) {
......
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