24 QString QgsHillshadeAlgorithm::name()
const 26 return QStringLiteral(
"hillshade" );
29 QString QgsHillshadeAlgorithm::displayName()
const 31 return QObject::tr(
"Hillshade" );
34 QStringList QgsHillshadeAlgorithm::tags()
const 36 return QObject::tr(
"dem,hillshade,terrain" ).split(
',' );
39 QString QgsHillshadeAlgorithm::group()
const 41 return QObject::tr(
"Raster terrain analysis" );
44 QString QgsHillshadeAlgorithm::groupId()
const 46 return QStringLiteral(
"rasterterrainanalysis" );
49 QString 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)." );
56 QgsHillshadeAlgorithm *QgsHillshadeAlgorithm::createInstance()
const 58 return new QgsHillshadeAlgorithm();
61 void QgsHillshadeAlgorithm::initAlgorithm(
const QVariantMap & )
76 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
81 double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
82 double azimuth = parameterAsDouble( parameters, QStringLiteral(
"AZIMUTH" ), context );
83 double vAngle = parameterAsDouble( parameters, QStringLiteral(
"V_ANGLE" ), context );
85 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
86 QFileInfo fi( outputFile );
91 hillshade.processRaster( feedback );
94 outputs.insert( QStringLiteral(
"OUTPUT" ), outputFile );
void setZFactor(double factor)
Base class for providing feedback from a processing algorithm.
Represents a raster layer.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
static QString driverForExtension(const QString &extension)
Returns the GDAL driver name for a specified file extension.
A raster layer parameter for processing algorithms.
Custom exception class for processing related exceptions.
A numeric parameter for processing algorithms.
QString source() const
Returns the source for the layer.
Contains information about the context in which a processing algorithm is executed.