From 1fc082c3f964467a6efb38c784b9326aefd2d19c Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@c-s.fr>
Date: Thu, 25 Oct 2007 12:13:06 +0000
Subject: [PATCH] Correction examples de projections

---
 .../Projections/OrthoRectificationExample.cxx |  8 +++----
 Examples/Projections/SensorModelExample.cxx   | 23 +++++++++++++------
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/Examples/Projections/OrthoRectificationExample.cxx b/Examples/Projections/OrthoRectificationExample.cxx
index 03918f90f7..6a2f2e34af 100644
--- a/Examples/Projections/OrthoRectificationExample.cxx
+++ b/Examples/Projections/OrthoRectificationExample.cxx
@@ -73,9 +73,9 @@ int main( int argc, char* argv[] )
 
   ossimInit::instance()->initialize(argc, argv);
 
-  if(argc!=10)
+  if(argc!=9)
     {
-    std::cout << argv[0] <<" <input filename> <output filename> <originLatitude> <originLongitude> <x_Size> <y_Size> <x_groundSamplingDistance> <y_groundSamplingDistance>" 
+    std::cout << argv[0] <<" <input_filename> <output_filename> <x_ground_upper_left_corner> <y_ground_upper_left_corner> <x_Size> <y_Size> <x_groundSamplingDistance> <y_groundSamplingDistance (should be negative since origin is upper left)>" 
 	      << std::endl;
 
     return EXIT_FAILURE;
@@ -181,8 +181,8 @@ int main( int argc, char* argv[] )
   orthoRectifFilter->SetSize(size);
 				
   ImageType::SpacingType spacing;
-  spacing[0]=atof(argv[8]);
-  spacing[1]=atof(argv[9]);
+  spacing[0]=atof(argv[7]);
+  spacing[1]=atof(argv[8]);
   orthoRectifFilter->SetOutputSpacing(spacing);
 				
   ImageType::PointType origin;
diff --git a/Examples/Projections/SensorModelExample.cxx b/Examples/Projections/SensorModelExample.cxx
index 459ce1e476..6ab608c311 100644
--- a/Examples/Projections/SensorModelExample.cxx
+++ b/Examples/Projections/SensorModelExample.cxx
@@ -65,9 +65,9 @@ int main( int argc, char* argv[] )
 
   if(argc!=8)
     {
-    std::cout << argv[0] <<" <input filename> <output filename>"
-	      << "<latitude de l'origine> <longitude de l'origine>"
-              << "<taille_x> <taille_y> <NumberOfstreamDivisions>" 
+    std::cout << argv[0] <<" <input_filename> <output_filename>"
+	      << " <upper_left_corner_latitude> <upper_left_corner_longitude>"
+              << " <size_x> <sizee_y> <number_of_stream_divisions>" 
 	      << std::endl;
 
     return EXIT_FAILURE;
@@ -218,14 +218,23 @@ int main( int argc, char* argv[] )
   size[0]=atoi(argv[5]);      
   size[1]=atoi(argv[6]);	
 
+// Software Guide : EndCodeSnippet
+
+// Software Guide : BeginLatex
+//
+// The spacing in y direction is negative since origin is the upper left corner. 
+//
+// Software Guide : EndLatex
+
+// Software Guide : BeginCodeSnippet
   ImageType::SpacingType  		 spacing;
   spacing[0]=0.00001;
-  spacing[1]=0.00001;
+  spacing[1]=-0.00001; 
 
-  
+ 
   ImageType::PointType			 origin;
-  origin[0]=strtod(argv[3], NULL);         //latitude
-  origin[1]=strtod(argv[4], NULL);         //longitude
+  origin[0]=strtod(argv[3], NULL);         //longitude
+  origin[1]=strtod(argv[4], NULL);         //lattitude
 
   ImageType::RegionType			 region;
 
-- 
GitLab