QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
18 #ifndef QGSAGGREGATECALCULATOR_H
19 #define QGSAGGREGATECALCULATOR_H
21 #include "qgis_core.h"
90 StringConcatenateUnique
141 void setParameters(
const AggregateParameters ¶meters );
148 void setFilter(
const QString &filterExpression ) { mFilterExpression = filterExpression; }
162 QString
filter()
const {
return mFilterExpression; }
169 void setDelimiter(
const QString &delimiter ) { mDelimiter = delimiter; }
188 QVariant calculate( Aggregate aggregate,
const QString &fieldOrExpression,
197 static Aggregate stringToAggregate(
const QString &
string,
bool *ok =
nullptr );
203 static QString displayName( Aggregate aggregate );
210 static QList< QgsAggregateCalculator::AggregateInfo > aggregates();
218 QString mFilterExpression;
230 bool mFidsSet =
false;
232 mutable QString mLastError;
251 static QVariant calculate( Aggregate aggregate,
QgsFeatureIterator &fit, QVariant::Type resultType,
int userType,
253 const QString &delimiter,
258 QVariant defaultValue( Aggregate aggregate )
const;
261 #endif //QGSAGGREGATECALCULATOR_H
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QString delimiter
Delimiter to use for joining values with the StringConcatenate aggregate.
@ Range
Range of values (max - min) (numeric and datetime fields only)
QString name
A translated, human readable name.
Utility class for calculating aggregates for a field (or expression) over the features from a vector ...
QString filter() const
Returns the filter which limits the features used during the aggregate calculation.
@ Minority
Minority of values.
A bundle of parameters controlling aggregate calculation.
@ CountDistinct
Number of distinct values.
@ CountMissing
Number of missing (null) values.
@ ArrayAggregate
Create an array of values.
QgsFeatureRequest::OrderBy orderBy
Optional order by clauses.
@ InterQuartileRange
Inter quartile range (IQR) (numeric fields only)
@ StDevSample
Sample standard deviation of values (numeric fields only)
QString delimiter() const
Returns the delimiter used for joining values with the StringConcatenate aggregate.
void setFilter(const QString &filterExpression)
Sets a filter to limit the features used during the aggregate calculation.
@ StDev
Standard deviation of values (numeric fields only)
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Statistic
Enumeration of flags that specify statistics to be calculated.
@ StringMinimumLength
Minimum length of string (string fields only)
Statistic
Enumeration of flags that specify statistics to be calculated.
QSet< QVariant::Type > supportedTypes
This aggregate function can only be used with these datatypes.
@ Median
Median of values (numeric fields only)
QSet< QgsFeatureId > QgsFeatureIds
@ StringConcatenate
Concatenate values with a joining string (string fields only). Specify the delimiter using setDelimit...
@ Mean
Mean of values (numeric fields only)
QString lastError() const
Returns the last error encountered during the aggregate calculation.
Statistic
Enumeration of flags that specify statistics to be calculated.
@ ThirdQuartile
Third quartile (numeric fields only)
Aggregate
Available aggregates to calculate.
Represents a list of OrderByClauses, with the most important first and the least important last.
@ Majority
Majority of values.
Represents a vector layer which manages a vector based data sets.
Structured information about the available aggregates.
@ FirstQuartile
First quartile (numeric fields only)
QString filter
Optional filter for calculating aggregate over a subset of features, or an empty string to use all fe...
@ GeometryCollect
Create a multipart geometry from aggregated geometries.
void setDelimiter(const QString &delimiter)
Sets the delimiter to use for joining values with the StringConcatenate aggregate.
Class for parsing and evaluation of expressions (formerly called "search strings")....
Wrapper for iterator of features from vector data provider or vector layer.
@ StringMaximumLength
Maximum length of string (string fields only)