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(),
127 FeatureStats(
bool storeValues =
false,
bool storeValueCounts =
false )
128 : mStoreValues( storeValues )
129 , mStoreValueCounts( storeValueCounts )
137 max = std::numeric_limits<double>::lowest();
138 min = std::numeric_limits<double>::max();
143 void addValue(
double value,
double weight = 1.0 )
147 sum += value * weight;
155 min = std::min( min, value );
156 max = std::max( max, value );
157 if ( mStoreValueCounts )
158 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
160 values.append( value );
164 double max = std::numeric_limits<double>::lowest();
165 double min = std::numeric_limits<double>::max();
166 QMap< double, int > valueCount;
167 QList< double > values;
170 bool mStoreValues =
false;
171 bool mStoreValueCounts =
false;
174 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
179 double mCellSizeX = 0;
180 double mCellSizeY = 0;
185 QString mAttributePrefix;
189 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsZonalStatistics::Statistics )
193 #endif // QGSZONALSTATISTICS_H A rectangle specified with double values.
Statistic
Enumeration of flags that specify statistics to be calculated.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
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.