Skip to content
Permalink
Browse files

override default value only when tool executed from GUI

(cherry picked from commit 7c1d29c)
  • Loading branch information
alexbruy authored and nyalldawson committed Dec 21, 2020
1 parent af18a3b commit 6d4df441c08b72b60292d72e725aaa66186651fe
Showing with 7 additions and 4 deletions.
  1. +7 −4 python/plugins/processing/algs/gdal/rasterize.py
@@ -23,6 +23,7 @@

import os

from qgis.PyQt.QtCore import QVariant
from qgis.PyQt.QtGui import QIcon

from qgis.core import (QgsRasterFileWriter,
@@ -96,10 +97,12 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))
self.addParameter(QgsProcessingParameterExtent(self.EXTENT,
self.tr('Output extent')))
self.addParameter(QgsProcessingParameterNumber(self.NODATA,
self.tr('Assign a specified nodata value to output bands'),
type=QgsProcessingParameterNumber.Double,
optional=True))
nodataParam = QgsProcessingParameterNumber(self.NODATA,
self.tr('Assign a specified nodata value to output bands'),
type=QgsProcessingParameterNumber.Double,
optional=True)
nodataParam.setGuiDefaultValueOverride(QVariant(QVariant.Double))
self.addParameter(nodataParam)

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation options'),

0 comments on commit 6d4df44

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