24QString QgsHillshadeAlgorithm::name()
const
26 return QStringLiteral(
"hillshade" );
29QString QgsHillshadeAlgorithm::displayName()
const
31 return QObject::tr(
"Hillshade" );
34QStringList QgsHillshadeAlgorithm::tags()
const
36 return QObject::tr(
"dem,hillshade,terrain" ).split(
',' );
39QString QgsHillshadeAlgorithm::group()
const
41 return QObject::tr(
"Raster terrain analysis" );
44QString QgsHillshadeAlgorithm::groupId()
const
46 return QStringLiteral(
"rasterterrainanalysis" );
49QString QgsHillshadeAlgorithm::shortHelpString()
const
51 return QObject::tr(
"This algorithm calculates the hillshade of the Digital Terrain Model in input." )
52 + QStringLiteral(
"\n\n" )
53 + QObject::tr(
"The shading of the layer is calculated according to the sun position (azimuth and elevation)." );
56QgsHillshadeAlgorithm *QgsHillshadeAlgorithm::createInstance()
const
58 return new QgsHillshadeAlgorithm();
61void QgsHillshadeAlgorithm::initAlgorithm(
const QVariantMap & )
73 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
78 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
79 const double azimuth = parameterAsDouble( parameters, QStringLiteral(
"AZIMUTH" ), context );
80 const double vAngle = parameterAsDouble( parameters, QStringLiteral(
"V_ANGLE" ), context );
82 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
83 const QFileInfo fi( outputFile );
87 hillshade.setZFactor( zFactor );
88 hillshade.processRaster( feedback );
91 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.