25QString QgsAspectAlgorithm::name()
const
27 return QStringLiteral(
"aspect" );
30QString QgsAspectAlgorithm::displayName()
const
32 return QObject::tr(
"Aspect" );
35QStringList QgsAspectAlgorithm::tags()
const
37 return QObject::tr(
"dem,aspect,terrain,slope" ).split(
',' );
40QString QgsAspectAlgorithm::group()
const
42 return QObject::tr(
"Raster terrain analysis" );
45QString QgsAspectAlgorithm::groupId()
const
47 return QStringLiteral(
"rasterterrainanalysis" );
50QString QgsAspectAlgorithm::shortHelpString()
const
52 return QObject::tr(
"This algorithm calculates the aspect of the Digital Terrain Model in input." )
53 + QStringLiteral(
"\n\n" )
54 + QObject::tr(
"The final aspect raster layer contains values from 0 to 360 that express "
55 "the slope direction: starting from North (0°) and continuing clockwise." );
58QString QgsAspectAlgorithm::shortDescription()
const
60 return QObject::tr(
"Generates a raster layer representing the slope direction from a Digital Terrain Model." );
63QgsAspectAlgorithm *QgsAspectAlgorithm::createInstance()
const
65 return new QgsAspectAlgorithm();
68void QgsAspectAlgorithm::initAlgorithm(
const QVariantMap & )
78 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
83 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
85 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
86 const QFileInfo fi( outputFile );
90 aspect.setZFactor( zFactor );
91 aspect.processRaster( feedback );
94 outputs.insert( QStringLiteral(
"OUTPUT" ), outputFile );
@ Double
Double/float values.
Calculates aspect values in a window of 3x3 cells based on first order derivatives in x- and y- direc...
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.