18#ifndef QGSZONALSTATISTICS_H
19#define QGSZONALSTATISTICS_H
27#include "qgis_analysis.h"
139 FeatureStats(
bool storeValues =
false,
bool storeValueCounts =
false )
140 : mStoreValues( storeValues )
141 , mStoreValueCounts( storeValueCounts )
149 max = std::numeric_limits<double>::lowest();
150 min = std::numeric_limits<double>::max();
155 void addValue(
double value,
const QgsPointXY &point,
double weight = 1.0 )
159 sum += value * weight;
177 if ( mStoreValueCounts )
178 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
180 values.append( value );
184 double max = std::numeric_limits<double>::lowest();
185 double min = std::numeric_limits<double>::max();
188 QMap<double, int> valueCount;
189 QList<double> values;
192 bool mStoreValues =
false;
193 bool mStoreValueCounts =
false;
196 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
201 double mCellSizeX = 0;
202 double mCellSizeY = 0;
207 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 ...