From 9b3bc6f6cefdf4de4026ff8faff74369419ef6d1 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Wed, 20 Jun 2012 17:13:48 +0200
Subject: [PATCH] BUG: Handling negative spacing case

---
 Applications/Rasterization/otbRasterization.cxx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Applications/Rasterization/otbRasterization.cxx b/Applications/Rasterization/otbRasterization.cxx
index 88d404e0cb..09e5945be5 100644
--- a/Applications/Rasterization/otbRasterization.cxx
+++ b/Applications/Rasterization/otbRasterization.cxx
@@ -254,8 +254,8 @@ private:
         }
       else if(extentAvailable)
         {
-        origin[0] = ulx;
-        origin[1] = uly;
+        origin[0] = (spacing[0] > 0 ? ulx : lrx);
+        origin[1] = (spacing[1] > 0 ? uly : lry);
         
         // Transform to output EPSG
        
@@ -283,8 +283,8 @@ private:
         {
         // Transform to output EPSG
         PointType lrout;
-        lrout[0] = lrx;
-        lrout[1] = lry;
+        lrout[0] = (spacing[0] > 0 ? lrx : ulx);
+        lrout[1] = (spacing[1] > 0 ? lry : uly);
 
         if(validInputProjRef)
           {
-- 
GitLab