18#ifndef QGSALGORITHMUPSLOPEAREA_H
19#define QGSALGORITHMUPSLOPEAREA_H
38 QgsUpslopeAreaAlgorithmBase() =
default;
40 QString
group()
const override;
41 QString
groupId()
const override;
42 QStringList
tags()
const override;
44 QList<QgsProcessingAlgorithm::ExternalLink>
externalLinks()
const override;
47 enum class Method :
int
56 void addCommonParameters();
62 void computeCellValue(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY, Method method,
double converge,
bool contour );
63 void computeD8(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY );
64 void computeDInf(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY );
65 void computeMFD(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY,
double converge,
bool contour );
66 void computeMMDGFD(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY,
bool contour );
67 void computeMDInf(
const QgsRasterBlock *demBlock,
int col,
int row,
int cols,
int rows,
double cellSizeX,
double cellSizeY,
double converge );
69 std::unique_ptr<QgsRasterInterface> mDemProvider;
71 std::unique_ptr<QgsRasterInterface> mRouteProvider;
75 double mCellSizeX = 0.0;
76 double mCellSizeY = 0.0;
77 double mDemNoData = -9999.0;
78 double mRouteNoData = -9999.0;
81 std::vector<double> mRouteData;
82 std::vector<double> mFlowData;
84 Method mMethod = Method::MFD;
85 double mConvergence = 1.1;
86 bool mMfdContour =
false;
88 QString mOutputFormat;
89 QString mCreationOptions;
90 double mOutputNoData = -9999;
97class QgsUpslopeAreaPointAlgorithm :
public QgsUpslopeAreaAlgorithmBase
100 QgsUpslopeAreaPointAlgorithm();
102 QString name()
const override;
103 QString displayName()
const override;
104 QString shortDescription()
const override;
105 QString shortHelpString()
const override;
106 QgsProcessingAlgorithm *createInstance()
const override;
108 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
111 bool prepareAlgorithm(
const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
override;
112 QVariantMap processAlgorithm(
const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
override;
119class QgsUpslopeAreaLayerAlgorithm :
public QgsUpslopeAreaAlgorithmBase
122 QgsUpslopeAreaLayerAlgorithm();
124 QString name()
const override;
125 QString displayName()
const override;
126 QString shortDescription()
const override;
127 QString shortHelpString()
const override;
128 QgsProcessingAlgorithm *createInstance()
const override;
130 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
133 bool prepareAlgorithm(
const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
override;
134 QVariantMap processAlgorithm(
const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
override;
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 QStringList tags() const
Returns a list of tags which relate to the algorithm, and are used to assist users in searching for s...
virtual QList< QgsProcessingAlgorithm::ExternalLink > externalLinks() const
Returns a list of external links describing the algorithm's behavior or source.
virtual QList< QgsAcademicReference > academicReferences() const
Returns the list of academic references describing the logic and processes used by the algorithm.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A rectangle specified with double values.