diff --git a/Modules/Radiometry/SARCalibration/test/otbSarDeburstFilterTest.cxx b/Modules/Radiometry/SARCalibration/test/otbSarDeburstFilterTest.cxx index 5d0f320c83194842843803a09b87cd78db05c3ad..d221088626f509462223f9cbbb93a6ce8d96c75a 100644 --- a/Modules/Radiometry/SARCalibration/test/otbSarDeburstFilterTest.cxx +++ b/Modules/Radiometry/SARCalibration/test/otbSarDeburstFilterTest.cxx @@ -40,7 +40,23 @@ int otbSarDeburstFilterTest(int itkNotUsed(argc), char * argv[]) writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); - + + // check that there is now a single burst in data + reader = ReaderType::New(); + reader->SetFileName(argv[2]); + reader->UpdateOutputInformation(); + + unsigned int nb_bursts = atoi(reader->GetOutput()->GetImageKeywordlist().GetMetadataByKey("support_data.geom.bursts.number").c_str()); + + if(nb_bursts != 1) + { + std::cerr<<"Error: more than 1 burst ("<<nb_bursts<<" bursts) found in output metadata."<<std::endl; + } + else + { + std::cout<<"Metadata have a single burst as expected."<<std::endl; + } + return EXIT_SUCCESS; } diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp index 46381857ea6df04347140969650827588ab1b395..e8e5a6ef827ff7d19e5500aeab9fad46ebb7e0f2 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp @@ -1218,13 +1218,18 @@ namespace ossimplugins static const char MODULE[] = "ossimplugins::ossimSarSensorModel::saveState"; SCOPED_LOG(traceDebug, MODULE); - kwl.add(prefix, - ossimKeywordNames::TYPE_KW, - "ossimSarSensorModel", - true); - - add(kwl, SUPPORT_DATA_PREFIX + "product_type", theProductType.ToString().data()); + // Prevent override of subclasses TYPE_KW + + if(!kwl.hasKey(ossimKeywordNames::TYPE_KW)) + { + kwl.add(prefix, + ossimKeywordNames::TYPE_KW, + "ossimSarSensorModel", + true); + } + std::string product_type = theProductType.ToString().data(); + add(kwl, SUPPORT_DATA_PREFIX + "product_type", product_type); add(kwl, SUPPORT_DATA_PREFIX, "slant_range_to_first_pixel", theNearRangeTime ); add(kwl, SUPPORT_DATA_PREFIX, "range_sampling_rate" , theRangeSamplingRate ); add(kwl, SUPPORT_DATA_PREFIX, "range_spacing" , theRangeResolution ); diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp index 17d764ceb1650dc38355703dd31006947a3b7ec8..3cc96023f4e44379f3e1891f8321cee54c474b70 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp @@ -150,11 +150,8 @@ namespace ossimplugins kwl.addList(theManifestKwl, true); kwl.addList(theProductKwl, true); - - const unsigned int k_version = 2; - add(kwl, HEADER_PREFIX, "version", k_version); - return ossimSensorModel::saveState(kwl, prefix); + return ossimSarSensorModel::saveState(kwl, prefix); }