[QGIS Commit] r11759 - trunk/qgis/src/analysis/interpolation

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Oct 6 14:36:45 EDT 2009


Author: mhugent
Date: 2009-10-06 14:36:44 -0400 (Tue, 06 Oct 2009)
New Revision: 11759

Modified:
   trunk/qgis/src/analysis/interpolation/qgsgridfilewriter.cpp
Log:
Fix for shifted values in interpolation plugin

Modified: trunk/qgis/src/analysis/interpolation/qgsgridfilewriter.cpp
===================================================================
--- trunk/qgis/src/analysis/interpolation/qgsgridfilewriter.cpp	2009-10-06 17:49:35 UTC (rev 11758)
+++ trunk/qgis/src/analysis/interpolation/qgsgridfilewriter.cpp	2009-10-06 18:36:44 UTC (rev 11759)
@@ -55,7 +55,7 @@
   outStream.setRealNumberPrecision( 8 );
   writeHeader( outStream );
 
-  double currentYValue = mInterpolationExtent.yMaximum();
+  double currentYValue = mInterpolationExtent.yMaximum() - mCellSizeY / 2.0; //calculate value in the center of the cell
   double currentXValue;
   double interpolatedValue;
 
@@ -68,7 +68,7 @@
 
   for ( int i = 0; i < mNumRows; ++i )
   {
-    currentXValue = mInterpolationExtent.xMinimum();
+    currentXValue = mInterpolationExtent.xMinimum() + mCellSizeX / 2.0; //calculate value in the center of the cell
     for ( int j = 0; j < mNumColumns; ++j )
     {
       if ( mInterpolator->interpolatePoint( currentXValue, currentYValue, interpolatedValue ) == 0 )



More information about the QGIS-commit mailing list