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,
double weight = 1.0 )
171 sum += value * weight;
179 min = std::min( min, value );
180 max = std::max( max, value );
181 if ( mStoreValueCounts )
182 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
184 values.append( value );
188 double max = std::numeric_limits<double>::lowest();
189 double min = std::numeric_limits<double>::max();
190 QMap< double, int > valueCount;
191 QList< double > values;
194 bool mStoreValues =
false;
195 bool mStoreValueCounts =
false;
198 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
203 double mCellSizeX = 0;
204 double mCellSizeY = 0;
209 QString mAttributePrefix;
ZonalStatistic
Statistics to be calculated during a zonal statistics operation.
@ Default
Default statistics.
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.
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 ...