25QString QgsRuggednessAlgorithm::name()
const
27 return QStringLiteral(
"ruggednessindex" );
30QString QgsRuggednessAlgorithm::displayName()
const
32 return QObject::tr(
"Ruggedness index" );
35QStringList QgsRuggednessAlgorithm::tags()
const
37 return QObject::tr(
"dem,ruggedness,index,terrain" ).split(
',' );
40QString QgsRuggednessAlgorithm::group()
const
42 return QObject::tr(
"Raster terrain analysis" );
45QString QgsRuggednessAlgorithm::groupId()
const
47 return QStringLiteral(
"rasterterrainanalysis" );
50QString QgsRuggednessAlgorithm::shortHelpString()
const
52 return QObject::tr(
"This algorithm calculates the quantitative measurement of terrain "
53 "heterogeneity described by Riley et al. (1999)." )
54 + QStringLiteral(
"\n\n" )
55 + QObject::tr(
"It is calculated for every location, by summarizing the change "
56 "in elevation within the 3x3 pixel grid. Each pixel contains the "
57 "difference in elevation from a center cell and the 8 cells surrounding it." );
60QString QgsRuggednessAlgorithm::shortDescription()
const
62 return QObject::tr(
"Calculates the quantitative measurement of terrain heterogeneity described by Riley et al. (1999)." );
65QgsRuggednessAlgorithm *QgsRuggednessAlgorithm::createInstance()
const
67 return new QgsRuggednessAlgorithm();
70void QgsRuggednessAlgorithm::initAlgorithm(
const QVariantMap & )
80 QgsRasterLayer *inputLayer = parameterAsRasterLayer( parameters, QStringLiteral(
"INPUT" ), context );
85 const double zFactor = parameterAsDouble( parameters, QStringLiteral(
"Z_FACTOR" ), context );
87 const QString outputFile = parameterAsOutputLayer( parameters, QStringLiteral(
"OUTPUT" ), context );
88 const QFileInfo fi( outputFile );
92 ruggedness.setZFactor( zFactor );
93 ruggedness.processRaster( feedback );
96 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.
Calculates the ruggedness index based on a 3x3 moving window.