18#ifndef QGSALGORITHMCELLSTATISTICS_H
19#define QGSALGORITHMCELLSTATISTICS_H
35 QString
group()
const final;
37 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
final;
41 virtual void addSpecificAlgorithmParams() = 0;
47 std::vector< QgsRasterAnalysisUtils::RasterLogicInput > mInputs;
48 bool mIgnoreNoData =
false;
50 double mNoDataValue = -9999;
55 double mRasterUnitsPerPixelX = 0;
56 double mRasterUnitsPerPixelY = 0;
60class QgsCellStatisticsAlgorithm :
public QgsCellStatisticsAlgorithmBase
63 QgsCellStatisticsAlgorithm() =
default;
65 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatistics.svg" ) ); }
66 QString name()
const override;
67 QString displayName()
const override;
68 QStringList tags()
const override;
69 QString shortHelpString()
const override;
70 QgsCellStatisticsAlgorithm *createInstance() const override
SIP_FACTORY;
73 void addSpecificAlgorithmParams() override;
78 QgsRasterAnalysisUtils::CellValueStatisticMethods mMethod = QgsRasterAnalysisUtils::CellValueStatisticMethods::Sum;
83class QgsCellStatisticsPercentileAlgorithm : public QgsCellStatisticsAlgorithmBase
86 QgsCellStatisticsPercentileAlgorithm() =
default;
87 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentile.svg" ) ); }
88 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentile.svg" ) ); }
89 QString name()
const override;
90 QString displayName()
const override;
91 QStringList tags()
const override;
92 QString shortHelpString()
const override;
93 QgsCellStatisticsPercentileAlgorithm *createInstance() const override
SIP_FACTORY;
96 void addSpecificAlgorithmParams() override;
101 QgsRasterAnalysisUtils::CellValuePercentileMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentileMethods::NearestRankPercentile;
102 double mPercentile = 0.0;
106class QgsCellStatisticsPercentRankFromValueAlgorithm : public QgsCellStatisticsAlgorithmBase
109 QgsCellStatisticsPercentRankFromValueAlgorithm() =
default;
110 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
111 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
112 QString name()
const override;
113 QString displayName()
const override;
114 QStringList tags()
const override;
115 QString shortHelpString()
const override;
116 QgsCellStatisticsPercentRankFromValueAlgorithm *createInstance() const override
SIP_FACTORY;
119 void addSpecificAlgorithmParams() override;
124 QgsRasterAnalysisUtils::CellValuePercentRankMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentRankMethods::InterpolatedPercentRankInc;
130class QgsCellStatisticsPercentRankFromRasterAlgorithm : public QgsCellStatisticsAlgorithmBase
133 QgsCellStatisticsPercentRankFromRasterAlgorithm() =
default;
134 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
135 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
136 QString name()
const override;
137 QString displayName()
const override;
138 QStringList tags()
const override;
139 QString shortHelpString()
const override;
140 QgsCellStatisticsPercentRankFromRasterAlgorithm *createInstance() const override
SIP_FACTORY;
143 void addSpecificAlgorithmParams() override;
148 QgsRasterAnalysisUtils::CellValuePercentRankMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentRankMethods::InterpolatedPercentRankInc;
150 int mValueRasterBand = 1;
DataType
Raster data types.
@ UnknownDataType
Unknown or unspecified type.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
This class represents a coordinate reference system (CRS).
Abstract base class for processing algorithms.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
virtual QVariantMap processAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)=0
Runs the algorithm using the specified parameters.
virtual bool prepareAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)
Prepares the algorithm to run using the specified parameters.
virtual void initAlgorithm(const QVariantMap &configuration=QVariantMap())=0
Initializes the algorithm using the specified configuration.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
Base class for raster data providers.
Base class for processing filters like renderers, reprojector, resampler etc.
A rectangle specified with double values.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.