Skip to content
Permalink
Browse files

expose advanced NoData parameter

  • Loading branch information
root676 authored and nyalldawson committed Jul 2, 2020
1 parent 5045063 commit 95cd14d682042690b2bbce74647b9bce67743944
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/analysis/processing/qgsalgorithmcellstatistics.cpp
@@ -111,6 +111,10 @@ void QgsCellStatisticsAlgorithm::initAlgorithm( const QVariantMap & )

addParameter( new QgsProcessingParameterRasterLayer( QStringLiteral( "REF_LAYER" ), QObject::tr( "Reference layer" ) ) );

std::unique_ptr< QgsProcessingParameterNumber > output_nodata_parameter = qgis::make_unique< QgsProcessingParameterNumber >( QStringLiteral( "OUTPUT_NODATA_VALUE" ), QObject::tr( "Output NoData value" ), QgsProcessingParameterNumber::Double, -9999, true);
output_nodata_parameter->setFlags( output_nodata_parameter->flags() | QgsProcessingParameterDefinition::FlagAdvanced );
addParameter( output_nodata_parameter.release() );

addParameter( new QgsProcessingParameterRasterDestination( QStringLiteral( "OUTPUT" ),
QObject::tr( "Output layer" ) ) );

@@ -128,7 +132,7 @@ bool QgsCellStatisticsAlgorithm::prepareAlgorithm( const QVariantMap &parameters
throw QgsProcessingException( invalidRasterError( parameters, QStringLiteral( "REF_LAYER" ) ) );

mIgnoreNoData = parameterAsBool( parameters, QStringLiteral( "IGNORE_NODATA" ), context);

mNoDataValue = parameterAsDouble( parameters, QStringLiteral( "OUTPUT_NODATA_VALUE" ), context);
mCrs = referenceLayer->crs();
mRasterUnitsPerPixelX = referenceLayer->rasterUnitsPerPixelX();
mRasterUnitsPerPixelY = referenceLayer->rasterUnitsPerPixelY();

0 comments on commit 95cd14d

Please sign in to comment.
You can’t perform that action at this time.