2017-05-21 22:18:04 +07:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/vector/qgszonalstatistics.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-09-28 14:44:28 +03:00
|
|
|
|
2017-06-27 18:09:44 +07:00
|
|
|
|
|
|
|
|
2011-09-28 14:44:28 +03:00
|
|
|
class QgsZonalStatistics
|
|
|
|
{
|
2017-05-21 22:18:04 +07:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
A class that calculates raster statistics (count, sum, mean) for a polygon or multipolygon layer and appends the results as attributes*
|
2011-09-28 14:44:28 +03:00
|
|
|
%End
|
|
|
|
|
2017-05-21 22:18:04 +07:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgszonalstatistics.h"
|
|
|
|
%End
|
2011-09-28 14:44:28 +03:00
|
|
|
public:
|
2015-04-20 18:20:02 +10:00
|
|
|
|
|
|
|
enum Statistic
|
|
|
|
{
|
2017-05-21 22:18:04 +07:00
|
|
|
Count,
|
|
|
|
Sum,
|
|
|
|
Mean,
|
|
|
|
Median,
|
|
|
|
StDev,
|
|
|
|
Min,
|
|
|
|
Max,
|
|
|
|
Range,
|
|
|
|
Minority,
|
|
|
|
Majority,
|
|
|
|
Variety,
|
2017-06-29 09:47:08 +07:00
|
|
|
Variance,
|
2015-04-20 18:20:02 +10:00
|
|
|
All
|
|
|
|
};
|
|
|
|
typedef QFlags<QgsZonalStatistics::Statistic> Statistics;
|
|
|
|
|
2011-09-28 14:44:28 +03:00
|
|
|
|
2017-05-29 08:48:09 +02:00
|
|
|
QgsZonalStatistics( QgsVectorLayer *polygonLayer,
|
|
|
|
QgsRasterLayer *rasterLayer,
|
2017-09-25 14:20:39 +10:00
|
|
|
const QString &attributePrefix = QString(),
|
2017-05-29 08:48:09 +02:00
|
|
|
int rasterBand = 1,
|
|
|
|
QgsZonalStatistics::Statistics stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean ) );
|
2017-05-21 22:18:04 +07:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsZonalStatistics.
|
2017-05-21 22:18:04 +07:00
|
|
|
%End
|
|
|
|
|
2017-06-27 18:09:44 +07:00
|
|
|
int calculateStatistics( QgsFeedback *feedback );
|
2017-05-21 22:18:04 +07:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Starts the calculation
|
|
|
|
|
2017-05-21 22:18:04 +07:00
|
|
|
:return: 0 in case of success*
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2011-09-28 14:44:28 +03:00
|
|
|
};
|
2015-04-20 18:20:02 +10:00
|
|
|
|
|
|
|
QFlags<QgsZonalStatistics::Statistic> operator|(QgsZonalStatistics::Statistic f1, QFlags<QgsZonalStatistics::Statistic> f2);
|
|
|
|
|
2017-05-21 22:18:04 +07:00
|
|
|
|
2017-09-25 14:20:39 +10:00
|
|
|
|
2017-05-21 22:18:04 +07:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/analysis/vector/qgszonalstatistics.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|