25QString QgsSlopeAlgorithm::name()
const
27 return QStringLiteral(
"slope" );
30QString QgsSlopeAlgorithm::displayName()
const
32 return QObject::tr(
"Slope" );
35QStringList QgsSlopeAlgorithm::tags()
const
37 return QObject::tr(
"dem,slope,terrain" ).split(
',' );
40QString QgsSlopeAlgorithm::group()
const
42 return QObject::tr(
"Raster terrain analysis" );
45QString QgsSlopeAlgorithm::groupId()
const
47 return QStringLiteral(
"rasterterrainanalysis" );
50QString QgsSlopeAlgorithm::shortHelpString()
const
52 return QObject::tr(
"This algorithm calculates the angle of inclination "
53 "of the terrain from an input raster layer. The slope "
54 "is expressed in degrees." );
57QString QgsSlopeAlgorithm::shortDescription()
const
59 return QObject::tr(
"Calculates the angle of inclination of the terrain from an input raster layer." );
62QgsSlopeAlgorithm *QgsSlopeAlgorithm::createInstance()
const
64 return new QgsSlopeAlgorithm();
67void QgsSlopeAlgorithm::initAlgorithm(
const QVariantMap & )
77 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
82 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
84 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
85 const QFileInfo fi( outputFile );
89 slope.setZFactor( zFactor );
90 slope.processRaster( feedback );
93 outputs.insert( QStringLiteral(
"OUTPUT" ), outputFile );
@ Double
Double/float values.
QString source() const
Returns the source for the layer.
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A numeric parameter for processing algorithms.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
A raster layer parameter for processing algorithms.
static QString driverForExtension(const QString &extension)
Returns the GDAL driver name for a specified file extension.
Represents a raster layer.
Calculates slope values in a window of 3x3 cells based on first order derivatives in x- and y- direct...