Skip to content

Commit a994d55

Browse files
author
mhugent
committed
Fix for shifted values in interpolation plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11759 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e70a40a commit a994d55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/analysis/interpolation/qgsgridfilewriter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int QgsGridFileWriter::writeFile( bool showProgressDialog )
5555
outStream.setRealNumberPrecision( 8 );
5656
writeHeader( outStream );
5757

58-
double currentYValue = mInterpolationExtent.yMaximum();
58+
double currentYValue = mInterpolationExtent.yMaximum() - mCellSizeY / 2.0; //calculate value in the center of the cell
5959
double currentXValue;
6060
double interpolatedValue;
6161

@@ -68,7 +68,7 @@ int QgsGridFileWriter::writeFile( bool showProgressDialog )
6868

6969
for ( int i = 0; i < mNumRows; ++i )
7070
{
71-
currentXValue = mInterpolationExtent.xMinimum();
71+
currentXValue = mInterpolationExtent.xMinimum() + mCellSizeX / 2.0; //calculate value in the center of the cell
7272
for ( int j = 0; j < mNumColumns; ++j )
7373
{
7474
if ( mInterpolator->interpolatePoint( currentXValue, currentYValue, interpolatedValue ) == 0 )

0 commit comments

Comments
 (0)