QGIS API Documentation  2.10.1-Pisa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsninecellfilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsninecellfilter.h - description
3  -------------------
4  begin : August 6th, 2009
5  copyright : (C) 2009 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSNINECELLFILTER_H
19 #define QGSNINECELLFILTER_H
20 
21 #include <QString>
22 #include "gdal.h"
23 
24 class QProgressDialog;
25 
30 class ANALYSIS_EXPORT QgsNineCellFilter
31 {
32  public:
34  QgsNineCellFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
35  virtual ~QgsNineCellFilter();
39  int processRaster( QProgressDialog* p );
40 
41  double cellSizeX() const { return mCellSizeX; }
42  void setCellSizeX( double size ) { mCellSizeX = size; }
43  double cellSizeY() const { return mCellSizeY; }
44  void setCellSizeY( double size ) { mCellSizeY = size; }
45 
46  double zFactor() const { return mZFactor; }
47  void setZFactor( double factor ) { mZFactor = factor; }
48 
49  double inputNodataValue() const { return mInputNodataValue; }
50  void setInputNodataValue( double value ) { mInputNodataValue = value; }
51  double outputNodataValue() const { return mOutputNodataValue; }
52  void setOutputNodataValue( double value ) { mOutputNodataValue = value; }
53 
56  virtual float processNineCellWindow( float* x11, float* x21, float* x31,
57  float* x12, float* x22, float* x32,
58  float* x13, float* x23, float* x33 ) = 0;
59 
60  private:
61  //default constructor forbidden. We need input file, output file and format obligatory
63 
65  GDALDatasetH openInputFile( int& nCellsX, int& nCellsY );
68  GDALDriverH openOutputDriver();
71  GDALDatasetH openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver );
72 
73  protected:
74 
78 
79  double mCellSizeX;
80  double mCellSizeY;
86  double mZFactor;
87 };
88 
89 #endif // QGSNINECELLFILTER_H
void setZFactor(double factor)
void setCellSizeY(double size)
double inputNodataValue() const
double cellSizeY() const
void setInputNodataValue(double value)
void setCellSizeX(double size)
float mOutputNodataValue
The nodata value of the output layer.
double outputNodataValue() const
double mZFactor
Scale factor for z-value if x-/y- units are different to z-units (111120 for degree->meters and 37040...
void setOutputNodataValue(double value)
double zFactor() const
float mInputNodataValue
The nodata value of the input layer.
double cellSizeX() const
Base class for raster analysis methods that work with a 3x3 cell filter and calculate the value of ea...