18#ifndef QGSZONALSTATISTICS_H
19#define QGSZONALSTATISTICS_H
27#include "qgis_analysis.h"
60 const QString &attributePrefix = QString(),
93 double rasterUnitsPerPixelX,
94 double rasterUnitsPerPixelY,
95 const QString &attributePrefix = QString(),
151 FeatureStats(
bool storeValues =
false,
bool storeValueCounts =
false )
152 : mStoreValues( storeValues )
153 , mStoreValueCounts( storeValueCounts )
161 max = std::numeric_limits<double>::lowest();
162 min = std::numeric_limits<double>::max();
167 void addValue(
double value,
const QgsPointXY &point,
double weight = 1.0 )
171 sum += value * weight;
189 if ( mStoreValueCounts )
190 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
192 values.append( value );
196 double max = std::numeric_limits<double>::lowest();
197 double min = std::numeric_limits<double>::max();
200 QMap< double, int > valueCount;
201 QList< double > values;
204 bool mStoreValues =
false;
205 bool mStoreValueCounts =
false;
208 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
213 double mCellSizeX = 0;
214 double mCellSizeY = 0;
219 QString mAttributePrefix;
ZonalStatistic
Statistics to be calculated during a zonal statistics operation.
@ Default
Default statistics.
@ All
All statistics. For QGIS 3.x this includes ONLY numeric statistics, but for 4.0 this will be extended...
ZonalStatisticResult
Zonal statistics result codes.
QFlags< ZonalStatistic > ZonalStatistics
Statistics to be calculated during a zonal statistics operation.
This class represents a coordinate reference system (CRS).
An interface for objects which accept features via addFeature(s) methods.
An interface for objects which provide features via a getFeatures method.
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Encapsulate a field in an attribute table or data source.
A geometry is the spatial representation of a feature.
A class to represent a 2D point.
Base class for raster data providers.
Base class for processing filters like renderers, reprojector, resampler etc.
Represents a raster layer.
A rectangle specified with double values.
Represents a vector layer which manages a vector based data sets.
A class that calculates raster statistics (count, sum, mean) for a polygon or multipolygon layer and ...