From 1e49a57c6fa63e8daf02b625f5795effc941a117 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@cnes.fr>
Date: Tue, 30 Oct 2018 11:22:06 +0100
Subject: [PATCH] Resolve "Orthorectification regression in v6.6"

---
 .../AppSegmentation/app/otbLargeScaleMeanShift.cxx   |  2 +-
 .../src/otbWrapperMapProjectionParametersHandler.cxx | 12 ++----------
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
index 7a72e7f9a1..9d11b93046 100644
--- a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
@@ -209,7 +209,7 @@ private:
       }
     DisableParameter("mode.raster.out");
 
-    if( IsParameterEnabled( "cleanup" ) )
+    if( GetParameterInt( "cleanup" ) )
       {
       otbAppLogINFO( <<"Final clean-up ..." );
       for (unsigned int i=0 ; i<tmpFilenames.size() ; ++i)
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperMapProjectionParametersHandler.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperMapProjectionParametersHandler.cxx
index a4d4557c6d..69cc498e1c 100644
--- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperMapProjectionParametersHandler.cxx
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperMapProjectionParametersHandler.cxx
@@ -142,7 +142,7 @@ const std::string MapProjectionParametersHandler::GetProjectionRefFromChoice(con
 
     // Set the hem
     char hem = 'N';
-    if (!app->IsParameterEnabled(hemKey.str()))
+    if (!app->GetParameterInt(hemKey.str()))
       hem = 'S';
     utmProjection->SetHemisphere(hem);
 
@@ -241,15 +241,7 @@ void MapProjectionParametersHandler::InitializeUTMParameters(Application::Pointe
                                                genericRSEstimator->GetOutputOrigin()[1]);
     // Update the UTM Gui fields
     app->SetParameterInt(zoneKey.str(), zone);
-    if (genericRSEstimator->GetOutputOrigin()[1] > 0.)
-      {
-      app->EnableParameter(hemKey.str());
-      }
-    else
-      {
-      app->DisableParameter(hemKey.str());
-      }
-
+    app->SetParameterInt(hemKey.str(),genericRSEstimator->GetOutputOrigin()[1] > 0.);
     app->AutomaticValueOn(zoneKey.str());
     app->AutomaticValueOn(hemKey.str());
     }
-- 
GitLab