Fix for shifted values in interpolation plugin

git-svn-id: http://svn.osgeo.org/qgis/trunk@11759 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2009-10-06 18:36:44 +00:00
parent 7a1091ae58
commit 214146b1b5

View File

@ -55,7 +55,7 @@ int QgsGridFileWriter::writeFile( bool showProgressDialog )
outStream.setRealNumberPrecision( 8 ); outStream.setRealNumberPrecision( 8 );
writeHeader( outStream ); writeHeader( outStream );
double currentYValue = mInterpolationExtent.yMaximum(); double currentYValue = mInterpolationExtent.yMaximum() - mCellSizeY / 2.0; //calculate value in the center of the cell
double currentXValue; double currentXValue;
double interpolatedValue; double interpolatedValue;
@ -68,7 +68,7 @@ int QgsGridFileWriter::writeFile( bool showProgressDialog )
for ( int i = 0; i < mNumRows; ++i ) 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 ) for ( int j = 0; j < mNumColumns; ++j )
{ {
if ( mInterpolator->interpolatePoint( currentXValue, currentYValue, interpolatedValue ) == 0 ) if ( mInterpolator->interpolatePoint( currentXValue, currentYValue, interpolatedValue ) == 0 )