60 const QString &attributePrefix = QString(),
93 double rasterUnitsPerPixelX,
94 double rasterUnitsPerPixelY,
95 const QString &attributePrefix = QString(),
128 static QMap<Qgis::ZonalStatistic, QVariant> calculateStatistics(
QgsRasterInterface *rasterInterface,
const QgsGeometry &geometry,
double cellSizeX,
double cellSizeY,
int rasterBand, Qgis::ZonalStatistics statistics );
142 static QMap<int, QVariant> calculateStatisticsInt(
QgsRasterInterface *rasterInterface,
const QgsGeometry &geometry,
double cellSizeX,
double cellSizeY,
int rasterBand, Qgis::ZonalStatistics statistics )
SIP_PYNAME( calculateStatistics );
151 FeatureStats(
bool storeValues =
false,
bool storeValueCounts =
false )
152 : mStoreValues( storeValues )
153 , mStoreValueCounts( storeValueCounts )
161 max = std::numeric_limits<double>::lowest();
162 min = std::numeric_limits<double>::max();
167 void addValue(
double value,
double weight = 1.0 )
171 sum += value * weight;
179 min = std::min( min, value );
180 max = std::max( max, value );
181 if ( mStoreValueCounts )
182 valueCount.insert( value, valueCount.value( value, 0 ) + 1 );
184 values.append( value );
188 double max = std::numeric_limits<double>::lowest();
189 double min = std::numeric_limits<double>::max();
190 QMap< double, int > valueCount;
191 QList< double > values;
194 bool mStoreValues =
false;
195 bool mStoreValueCounts =
false;
198 QString getUniqueFieldName(
const QString &fieldName,
const QList<QgsField> &newFields );
203 double mCellSizeX = 0;
204 double mCellSizeY = 0;
209 QString mAttributePrefix;