18 #ifndef QGSAGGREGATECALCULATOR_H 19 #define QGSAGGREGATECALCULATOR_H 21 #include "qgis_core.h" 129 void setFilter(
const QString &filterExpression ) { mFilterExpression = filterExpression; }
135 QString
filter()
const {
return mFilterExpression; }
142 void setDelimiter(
const QString &delimiter ) { mDelimiter = delimiter; }
159 QVariant calculate(
Aggregate aggregate,
const QString &fieldOrExpression,
168 static Aggregate stringToAggregate(
const QString &
string,
bool *ok =
nullptr );
175 static QList< QgsAggregateCalculator::AggregateInfo > aggregates();
183 QString mFilterExpression;
192 static QVariant calculateNumericAggregate(
QgsFeatureIterator &fit,
int attr, QgsExpression *expression,
195 static QVariant calculateStringAggregate(
QgsFeatureIterator &fit,
int attr, QgsExpression *expression,
198 static QVariant calculateDateTimeAggregate(
QgsFeatureIterator &fit,
int attr, QgsExpression *expression,
202 static QVariant calculateArrayAggregate(
QgsFeatureIterator &fit,
int attr, QgsExpression *expression,
206 int attr, QgsExpression *expression,
207 const QString &delimiter,
209 static QVariant concatenateStrings(
QgsFeatureIterator &fit,
int attr, QgsExpression *expression,
212 QVariant defaultValue(
Aggregate aggregate )
const;
215 #endif //QGSAGGREGATECALCULATOR_H Wrapper for iterator of features from vector data provider or vector layer.
Third quartile (numeric fields only)
Inter quartile range (IQR) (numeric fields only)
Median of values (numeric fields only)
QSet< QVariant::Type > supportedTypes
This aggregate function can only be used with these datatypes.
void setDelimiter(const QString &delimiter)
Sets the delimiter to use for joining values with the StringConcatenate aggregate.
Statistic
Enumeration of flags that specify statistics to be calculated.
void setFilter(const QString &filterExpression)
Sets a filter to limit the features used during the aggregate calculation.
First quartile (numeric fields only)
Number of missing (null) values.
Statistic
Enumeration of flags that specify statistics to be calculated.
Utility class for calculating aggregates for a field (or expression) over the features from a vector ...
Structured information about the available aggregates.
Standard deviation of values (numeric fields only)
QString delimiter
Delimiter to use for joining values with the StringConcatenate aggregate.
Minimum length of string (string fields only)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QString name
A translated, human readable name.
Statistic
Enumeration of flags that specify statistics to be calculated.
QString filter() const
Returns the filter which limits the features used during the aggregate calculation.
Majority of values (numeric fields only)
Number of distinct values.
QString delimiter() const
Returns the delimiter used for joining values with the StringConcatenate aggregate.
Maximum length of string (string fields only)
QString filter
Optional filter for calculating aggregate over a subset of features, or an empty string to use all fe...
Mean of values (numeric fields only)
Concatenate values with a joining string (string fields only). Specify the delimiter using setDelimit...
Minority of values (numeric fields only)
Represents a vector layer which manages a vector based data sets.
Range of values (max - min) (numeric and datetime fields only)
Sample standard deviation of values (numeric fields only)
Aggregate
Available aggregates to calculate.
A bundle of parameters controlling aggregate calculation.