18#ifndef QGSALGORITHMCELLSTATISTICS_H
19#define QGSALGORITHMCELLSTATISTICS_H
34 QString
group()
const final;
36 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
final;
40 virtual void addSpecificAlgorithmParams() = 0;
46 std::vector<QgsRasterAnalysisUtils::RasterLogicInput> mInputs;
47 bool mIgnoreNoData =
false;
49 double mNoDataValue = -9999;
54 double mRasterUnitsPerPixelX = 0;
55 double mRasterUnitsPerPixelY = 0;
56 std::unique_ptr<QgsRasterDataProvider> mOutputRasterDataProvider;
59class QgsCellStatisticsAlgorithm :
public QgsCellStatisticsAlgorithmBase
62 QgsCellStatisticsAlgorithm() =
default;
64 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatistics.svg" ) ); }
65 QString name()
const override;
66 QString displayName()
const override;
67 QStringList tags()
const override;
68 QString shortHelpString()
const override;
69 QgsCellStatisticsAlgorithm *createInstance() const override
SIP_FACTORY;
72 void addSpecificAlgorithmParams() override;
77 QgsRasterAnalysisUtils::CellValueStatisticMethods mMethod = QgsRasterAnalysisUtils::CellValueStatisticMethods::Sum;
81class QgsCellStatisticsPercentileAlgorithm : public QgsCellStatisticsAlgorithmBase
84 QgsCellStatisticsPercentileAlgorithm() =
default;
85 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentile.svg" ) ); }
86 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentile.svg" ) ); }
87 QString name()
const override;
88 QString displayName()
const override;
89 QStringList tags()
const override;
90 QString shortHelpString()
const override;
91 QgsCellStatisticsPercentileAlgorithm *createInstance() const override
SIP_FACTORY;
94 void addSpecificAlgorithmParams() override;
99 QgsRasterAnalysisUtils::CellValuePercentileMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentileMethods::NearestRankPercentile;
100 double mPercentile = 0.0;
104class QgsCellStatisticsPercentRankFromValueAlgorithm : public QgsCellStatisticsAlgorithmBase
107 QgsCellStatisticsPercentRankFromValueAlgorithm() =
default;
108 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
109 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
110 QString name()
const override;
111 QString displayName()
const override;
112 QStringList tags()
const override;
113 QString shortHelpString()
const override;
114 QgsCellStatisticsPercentRankFromValueAlgorithm *createInstance() const override
SIP_FACTORY;
117 void addSpecificAlgorithmParams() override;
122 QgsRasterAnalysisUtils::CellValuePercentRankMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentRankMethods::InterpolatedPercentRankInc;
127class QgsCellStatisticsPercentRankFromRasterAlgorithm : public QgsCellStatisticsAlgorithmBase
130 QgsCellStatisticsPercentRankFromRasterAlgorithm() =
default;
131 QIcon icon()
const override {
return QgsApplication::getThemeIcon( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
132 QString svgIconPath()
const override {
return QgsApplication::iconPath( QStringLiteral(
"/algorithms/mAlgorithmCellStatisticsPercentRank.svg" ) ); }
133 QString name()
const override;
134 QString displayName()
const override;
135 QStringList tags()
const override;
136 QString shortHelpString()
const override;
137 QgsCellStatisticsPercentRankFromRasterAlgorithm *createInstance() const override
SIP_FACTORY;
140 void addSpecificAlgorithmParams() override;
145 QgsRasterAnalysisUtils::CellValuePercentRankMethods mMethod = QgsRasterAnalysisUtils::CellValuePercentRankMethods::InterpolatedPercentRankInc;
147 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 bool prepareAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback)
Prepares the algorithm to run using the specified parameters.
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)=0
Runs the algorithm 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 processing filters like renderers, reprojector, resampler etc.
A rectangle specified with double values.