23 #include <QProgressDialog>
26 : mInterpolator( i ), mOutputFilePath( outputPath ), mInterpolationExtent( extent ), mNumColumns( nCols ), mNumRows( nRows )
27 , mCellSizeX( cellSizeX ), mCellSizeY( cellSizeY )
46 if ( !outputFile.open( QFile::WriteOnly ) )
57 QTextStream outStream( &outputFile );
58 outStream.setRealNumberPrecision( 8 );
63 double interpolatedValue;
65 QProgressDialog* progressDialog = 0;
66 if ( showProgressDialog )
69 progressDialog->setWindowModality( Qt::WindowModal );
79 outStream << interpolatedValue <<
" ";
83 outStream <<
"-9999 ";
90 if ( showProgressDialog )
92 if ( progressDialog->wasCanceled() )
97 progressDialog->setValue( i );
107 QString fileName = fi.absolutePath() +
"/" + fi.completeBaseName() +
".prj";
108 QFile prjFile( fileName );
109 if ( !prjFile.open( QFile::WriteOnly ) )
113 QTextStream prjStream( &prjFile );
118 delete progressDialog;
125 outStream <<
"NROWS " <<
mNumRows << endl;
130 outStream <<
"CELLSIZE " <<
mCellSizeX << endl;
137 outStream <<
"NODATA_VALUE -9999" << endl;
A rectangle specified with double values.
Interface class for interpolations.
QgsVectorLayer * vectorLayer
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)
const QList< LayerData > & layerData() const
A layer together with the information about interpolation attribute / z-coordinate interpolation and ...
virtual int interpolatePoint(double x, double y, double &result)=0
Calculates interpolation value for map coordinates x, y.
QgsInterpolator * mInterpolator
const QgsCoordinateReferenceSystem & crs() const
Returns layer's spatial reference system.
Represents a vector layer which manages a vector based data sets.
int writeHeader(QTextStream &outStream)
double xMinimum() const
Get the x minimum value (left side of rectangle)