18 #ifndef QGSZONALSTATISTICS_H 19 #define QGSZONALSTATISTICS_H 27 #include "qgis_analysis.h" 62 All = Count | Sum | Mean | Median | StDev | Max | Min | Range | Minority | Majority | Variety | Variance
76 const QString &attributePrefix = QString(),
109 double rasterUnitsPerPixelX,
110 double rasterUnitsPerPixelY,
111 const QString &attributePrefix = QString(),
141 FeatureStats(
bool storeValues =
false,
bool storeValueCounts =
false )
142 : mStoreValues( storeValues )
143 , mStoreValueCounts( storeValueCounts )
151 max = std::numeric_limits<double>::lowest();
152 min = std::numeric_limits<double>::max();
157 void addValue(
double value,
double weight = 1.0 )
161 sum += value * weight;
169 min = std::min( min, value );
170 max = std::max( max, value );
171 if ( mStoreValueCounts )
172 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
174 values.append( value );
178 double max = std::numeric_limits<double>::lowest();
179 double min = std::numeric_limits<double>::max();
180 QMap< double, int > valueCount;
181 QList< double > values;
184 bool mStoreValues =
false;
185 bool mStoreValueCounts =
false;
188 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
193 double mCellSizeX = 0;
194 double mCellSizeY = 0;
199 QString mAttributePrefix;
203 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsZonalStatistics::Statistics )
207 #endif // QGSZONALSTATISTICS_H
A rectangle specified with double values.
Statistic
Enumeration of flags that specify statistics to be calculated.
Represents a raster layer.
A geometry is the spatial representation of a feature.
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.
Base class for processing filters like renderers, reprojector, resampler etc.
This class represents a coordinate reference system (CRS).
A class that calculates raster statistics (count, sum, mean) for a polygon or multipolygon layer and ...
Represents a vector layer which manages a vector based data sets.
Base class for raster data providers.