diff --git a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMGTIFF.tif b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMGTIFF.tif index 9662d6048e1b5bc4eef3ad7c00b24ecfb24db433..3b1b11efef094cc93a80d22849d312da21c7c4f9 100644 --- a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMGTIFF.tif +++ b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMGTIFF.tif @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:604ab2a554cb7f8b8bd2f793da761b944ea1585b267b19063d64fbdd8fe9bd75 -size 2471604 +oid sha256:39a2dd6ff12fd1ad13ce5c3014dac39b546aceb5e5d1fbb8a4bb7e58d06fcbeb +size 2002472 diff --git a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMSRTM.tif b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMSRTM.tif index 0c871089a6f291752cdfe701b38f59c8b8eb9db3..419e04824bcdb961f1fcc0e54fc1c5ecca21d05f 100644 --- a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMSRTM.tif +++ b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_DEMSRTM.tif @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0bf90e6e04a89d3876af4272815b3a47dd3cd2805ed3bdb6900a68ec3fb83a3 -size 2470925 +oid sha256:d684f0d16382f9a7402373b4e17dbc74c8d38b2e2a5ef0c95560374f4ae23a3f +size 2002472 diff --git a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_noDEM.tif b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_noDEM.tif index 22b97cb747f2ea635594d2d3fe1d3c99a82ad5b6..6a12b74e395f7e78dc669c19ea3463408fb01ebd 100644 --- a/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_noDEM.tif +++ b/Data/Baseline/OTB/Images/prTvOrthoRectification_sentinel1_noDEM.tif @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bfcce43b020c8838f1b710dd62cff8781dff095e88e056edf2df8863dc0ae3af -size 2471252 +oid sha256:1b8c6e80b58829d09ec7ad2b7cca3104c0fd1676a203361bda5493f0060d8fee +size 2002472 diff --git a/Modules/Filtering/Projection/test/CMakeLists.txt b/Modules/Filtering/Projection/test/CMakeLists.txt index e2e346b3c1805dd0124080886dde1d0356cdd5ee..adbca8d880be8c086e3e33a8d86c4424ebd1b0e9 100644 --- a/Modules/Filtering/Projection/test/CMakeLists.txt +++ b/Modules/Filtering/Projection/test/CMakeLists.txt @@ -188,6 +188,16 @@ RAPIDEYE/level1B/2008-12-25T005918_RE3_1B-NAC_397971_12345_band3.ntf SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043/measurement/s1a-s6-slc-vv-20150619t195043-20150619t195101-006447-00887d-001.tiff ) +set(TOLERANCE_RATIO +0 +0 +0 +0 +0 +0 +0.0002 +) + set(IMG_TYPE "pleiades-1" "wv2-1" @@ -303,6 +313,8 @@ foreach(current_img ${IMG_TEST_ORTHO}) list(GET RESOL ${IMGNB} current_resol ) list(GET GRIDSPACING ${IMGNB} current_grid_spacing) list(GET ISCOMPLEX ${IMGNB} current_is_compex) + list(GET TOLERANCE_RATIO ${IMGNB} current_tolerance_ratio) + math(EXPR IMGNB "${IMGNB} + 1") set( MODENB 0) @@ -313,6 +325,7 @@ foreach(current_img ${IMG_TEST_ORTHO}) otb_add_test(NAME prTvOrthoRectification_${current_imgtype}_${current_mode} COMMAND otbProjectionTestDriver --compare-image ${EPSILON_4} ${BASELINE}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif ${TEMP}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif + --tolerance-ratio ${current_tolerance_ratio} otbOrthoRectificationFilter LARGEINPUT{${current_img}?&geom=${INPUTDATA}/${current_geomgcp}.geom} ${TEMP}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp index e57304fb7751a2ff0e330741cc179a2cb75c81d9..5819e87018a93914463a6dab2304002ce6563e1f 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp @@ -1058,29 +1058,39 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT theAzimuthTimeOffset = count > 0 ? cumulAzimuthTime / count : DurationType(0); - // Then, fix the range time - count=0; + // Patch_locS1 : do not fix the range time + // This fix takes GCPs as inputs to calculate an offset in range dimension. + // However for recent S1 products (after March 2017 with IPF >= 2.82), GCPs contain wrong values + // for lat/lon coordinates => the range time offset is wrong and shift the localization. + // To avoid wrong offset, fixRangeTimeWithGCPs is always set to false + bool fixRangeTimeWithGCPs = false; + + if (fixRangeTimeWithGCPs) + { + // Then, fix the range time + count=0; - for(std::vector<GCPRecordType>::const_iterator gcpIt = theGCPRecords.begin(); gcpIt!=theGCPRecords.end();++gcpIt) - { - ossimDpt estimatedImPt; - TimeType estimatedAzimuthTime; - double estimatedRangeTime; + for(std::vector<GCPRecordType>::const_iterator gcpIt = theGCPRecords.begin(); gcpIt!=theGCPRecords.end();++gcpIt) + { + ossimDpt estimatedImPt; + TimeType estimatedAzimuthTime; + double estimatedRangeTime; - ossimEcefPoint sensorPos; - ossimEcefVector sensorVel; + ossimEcefPoint sensorPos; + ossimEcefVector sensorVel; - // Estimate times - const bool s1 = this->worldToAzimuthRangeTime(gcpIt->worldPt,estimatedAzimuthTime,estimatedRangeTime, sensorPos, sensorVel); + // Estimate times + const bool s1 = this->worldToAzimuthRangeTime(gcpIt->worldPt,estimatedAzimuthTime,estimatedRangeTime, sensorPos, sensorVel); - if(s1) - { - cumulRangeTime+=-estimatedRangeTime+gcpIt->slantRangeTime; - ++count; - } - } + if(s1) + { + cumulRangeTime+=-estimatedRangeTime+gcpIt->slantRangeTime; + ++count; + } + } - theRangeTimeOffset = count > 0 ? cumulRangeTime/count : 0; + theRangeTimeOffset = count > 0 ? cumulRangeTime/count : 0; + } } void get(