Opened 16 years ago

Closed 16 years ago

#2615 closed defect (fixed)

TPS interpolation doesn't work with negative coordinates

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.5.4
Component: GDAL_Raster Version: 1.4.0
Severity: normal Keywords: tps
Cc: warmerdam


The following patch must be applied in thinplatespline.cpp. The initialization of the xmax and ymax is currently wrong when all GCP have negative x or y.

--- gdal.ori/alg/thinplatespline.cpp  2008-07-21 16:27:40.000000000 +0200
+++ gdal.wrk/alg/thinplatespline.cpp     2008-10-17 08:51:46.000000000 +0200

@@ -201,7 +201,7 @@

     // More than 2 points - first we have to check if it is 1D or 2D case

-    double xmax = FLT_MIN, xmin = FLT_MAX, ymax = FLT_MIN, ymin = FLT_MAX;
+    double xmax = x[0], xmin = x[0], ymax = y[0], ymin = y[0];
     double delx, dely;
     double xx, yy;
     double sumx = 0.0f, sumy= 0.0f, sumx2 = 0.0f, sumy2 = 0.0f, sumxy = 0.0f;

Change History (1)

comment:1 by Even Rouault, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk in r15547 and in branches/1.5 in r15548

Note: See TracTickets for help on using tickets.