QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsrasteranalysisutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasteranalysisutils.h
3  ---------------------
4  Date : June 2018
5  Copyright : (C) 2018 by Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSRASTERANALYSISUTILS_H
17 #define QGSRASTERANALYSISUTILS_H
18 
19 #include "qgis_analysis.h"
20 #include "qgis.h"
21 
22 #include <functional>
23 #include <memory>
24 
25 #define SIP_NO_FILE
26 
28 
29 class QgsRasterInterface;
30 class QgsGeometry;
31 class QgsRectangle;
33 
34 namespace QgsRasterAnalysisUtils
35 {
36 
40  void cellInfoForBBox( const QgsRectangle &rasterBBox, const QgsRectangle &featureBBox, double cellSizeX, double cellSizeY, int &nCellsX, int &nCellsY,
41  int rasterWidth, int rasterHeight,
42  QgsRectangle &rasterBlockExtent );
43 
45  void statisticsFromMiddlePointTest( QgsRasterInterface *rasterInterface, int rasterBand, const QgsGeometry &poly, int nCellsX, int nCellsY,
46  double cellSizeX, double cellSizeY, const QgsRectangle &rasterBBox, const std::function<void( double )> &addValue, bool skipNodata = true );
47 
49  void statisticsFromPreciseIntersection( QgsRasterInterface *rasterInterface, int rasterBand, const QgsGeometry &poly, int nCellsX, int nCellsY,
50  double cellSizeX, double cellSizeY, const QgsRectangle &rasterBBox, const std::function<void( double, double )> &addValue, bool skipNodata = true );
51 
53  bool validPixel( double value );
54 
59  std::unique_ptr< QgsProcessingParameterDefinition > createRasterTypeParameter( const QString &name,
60  const QString &description,
61  Qgis::DataType defaultType = Qgis::Float32 );
62 
67  Qgis::DataType rasterTypeChoiceToDataType( int choice );
68 }
69 
70 
72 
73 #endif // QGSRASTERANALYSISUTILS_H
A rectangle specified with double values.
Definition: qgsrectangle.h:40
DataType
Raster data types.
Definition: qgis.h:91
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:104
Thirty two bit floating point (float)
Definition: qgis.h:99
Base class for processing filters like renderers, reprojector, resampler etc.
Base class for the definition of processing parameters.