24 QString QgsSlopeAlgorithm::name()
const
26 return QStringLiteral(
"slope" );
29 QString QgsSlopeAlgorithm::displayName()
const
31 return QObject::tr(
"Slope" );
34 QStringList QgsSlopeAlgorithm::tags()
const
36 return QObject::tr(
"dem,slope,terrain" ).split(
',' );
39 QString QgsSlopeAlgorithm::group()
const
41 return QObject::tr(
"Raster terrain analysis" );
44 QString QgsSlopeAlgorithm::groupId()
const
46 return QStringLiteral(
"rasterterrainanalysis" );
49 QString QgsSlopeAlgorithm::shortHelpString()
const
51 return QObject::tr(
"This algorithm calculates the angle of inclination "
52 "of the terrain from an input raster layer. The slope "
53 "is expressed in degrees." );
56 QgsSlopeAlgorithm *QgsSlopeAlgorithm::createInstance()
const
58 return new QgsSlopeAlgorithm();
61 void QgsSlopeAlgorithm::initAlgorithm(
const QVariantMap & )
72 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
77 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
79 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
80 const QFileInfo fi( outputFile );
84 slope.setZFactor( zFactor );
85 slope.processRaster( feedback );
88 outputs.insert( QStringLiteral(
"OUTPUT" ), outputFile );