QGIS API Documentation  2.17.0-Master (f49f7ce)
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 
31 class ANALYSIS_EXPORT QgsNineCellFilter
32 {
33  public:
35  QgsNineCellFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat );
36  virtual ~QgsNineCellFilter();
40  int processRaster( QProgressDialog* p );
41 
42  double cellSizeX() const { return mCellSizeX; }
43  void setCellSizeX( double size ) { mCellSizeX = size; }
44  double cellSizeY() const { return mCellSizeY; }
45  void setCellSizeY( double size ) { mCellSizeY = size; }
46 
47  double zFactor() const { return mZFactor; }
48  void setZFactor( double factor ) { mZFactor = factor; }
49 
50  double inputNodataValue() const { return mInputNodataValue; }
51  void setInputNodataValue( double value ) { mInputNodataValue = value; }
52  double outputNodataValue() const { return mOutputNodataValue; }
53  void setOutputNodataValue( double value ) { mOutputNodataValue = value; }
54 
57  virtual float processNineCellWindow( float* x11, float* x21, float* x31,
58  float* x12, float* x22, float* x32,
59  float* x13, float* x23, float* x33 ) = 0;
60 
61  private:
62  //default constructor forbidden. We need input file, output file and format obligatory
64 
66  GDALDatasetH openInputFile( int& nCellsX, int& nCellsY );
69  GDALDriverH openOutputDriver();
72  GDALDatasetH openOutputFile( GDALDatasetH inputDataset, GDALDriverH outputDriver );
73 
74  protected:
75 
79 
80  double mCellSizeX;
81  double mCellSizeY;
87  double mZFactor;
88 };
89 
90 #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)
void * GDALDatasetH
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...