21 #include <QProgressDialog>
24 : mInterpolator( i ), mOutputFilePath( outputPath ), mInterpolationExtent( extent ), mNumColumns( nCols ), mNumRows( nRows )
25 , mCellSizeX( cellSizeX ), mCellSizeY( cellSizeY )
44 if ( !outputFile.open( QFile::WriteOnly ) )
55 QTextStream outStream( &outputFile );
56 outStream.setRealNumberPrecision( 8 );
61 double interpolatedValue;
63 QProgressDialog* progressDialog = 0;
64 if ( showProgressDialog )
67 progressDialog->setWindowModality( Qt::WindowModal );
77 outStream << interpolatedValue <<
" ";
81 outStream <<
"-9999 ";
88 if ( showProgressDialog )
90 if ( progressDialog->wasCanceled() )
95 progressDialog->setValue( i );
99 delete progressDialog;
106 outStream <<
"NROWS " <<
mNumRows << endl;
111 outStream <<
"CELLSIZE " <<
mCellSizeX << endl;
118 outStream <<
"NODATA_VALUE -9999" << endl;
A rectangle specified with double values.
Interface class for interpolations.
double yMaximum() const
Get the y maximum value (top side of rectangle)
int writeFile(bool showProgressDialog=false)
Writes the grid file.
QgsRectangle mInterpolationExtent
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
virtual int interpolatePoint(double x, double y, double &result)=0
Calculates interpolation value for map coordinates x, y.
QgsInterpolator * mInterpolator
int writeHeader(QTextStream &outStream)
double xMinimum() const
Get the x minimum value (left side of rectangle)