25QString QgsHillshadeAlgorithm::name()
const
27 return QStringLiteral(
"hillshade" );
30QString QgsHillshadeAlgorithm::displayName()
const
32 return QObject::tr(
"Hillshade" );
35QStringList QgsHillshadeAlgorithm::tags()
const
37 return QObject::tr(
"dem,hillshade,terrain" ).split(
',' );
40QString QgsHillshadeAlgorithm::group()
const
42 return QObject::tr(
"Raster terrain analysis" );
45QString QgsHillshadeAlgorithm::groupId()
const
47 return QStringLiteral(
"rasterterrainanalysis" );
50QString QgsHillshadeAlgorithm::shortHelpString()
const
52 return QObject::tr(
"This algorithm calculates the hillshade of the Digital Terrain Model in input." )
53 + QStringLiteral(
"\n\n" )
54 + QObject::tr(
"The shading of the layer is calculated according to the sun position (azimuth and elevation)." );
57QString QgsHillshadeAlgorithm::shortDescription()
const
59 return QObject::tr(
"Calculates the hillshade of a Digital Terrain Model." );
62QgsHillshadeAlgorithm *QgsHillshadeAlgorithm::createInstance()
const
64 return new QgsHillshadeAlgorithm();
67void QgsHillshadeAlgorithm::initAlgorithm(
const QVariantMap & )
79 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
84 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
85 const double azimuth = parameterAsDouble( parameters, QStringLiteral(
"AZIMUTH" ), context );
86 const double vAngle = parameterAsDouble( parameters, QStringLiteral(
"V_ANGLE" ), context );
88 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
89 const QFileInfo fi( outputFile );
93 hillshade.setZFactor( zFactor );
94 hillshade.processRaster( feedback );
97 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.