Skip to content
Permalink
Browse files

[processing] homogenize label for 'additional creation options'

parameter in GDAL algorithms
  • Loading branch information
alexbruy committed Aug 2, 2018
1 parent 11171a3 commit f5244603795a56b1e24f4b968cb22083cf34930a
@@ -71,7 +71,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -85,7 +85,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -73,7 +73,7 @@ def initAlgorithm(self, config=None):
options=[i[0] for i in self.modes],
defaultValue=2))
options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)

@@ -103,7 +103,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -117,7 +117,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -123,7 +123,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -110,7 +110,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -85,7 +85,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -98,7 +98,7 @@ def initAlgorithm(self, config=None):
defaultValue=0.0))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -74,7 +74,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -41,7 +41,6 @@

class gdalcalc(GdalAlgorithm):

OPTIONS = 'OPTIONS'
INPUT_A = 'INPUT_A'
INPUT_B = 'INPUT_B'
INPUT_C = 'INPUT_C'
@@ -57,10 +56,9 @@ class gdalcalc(GdalAlgorithm):
FORMULA = 'FORMULA'
OUTPUT = 'OUTPUT'
NO_DATA = 'NO_DATA'
EXTRA = 'EXTRA'
OPTIONS = 'OPTIONS'
RTYPE = 'RTYPE'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
#DEBUG = 'DEBUG'

def __init__(self):
super().__init__()
@@ -149,18 +147,9 @@ def initAlgorithm(self, config=None):
self.tr('Output raster type'),
options=self.TYPE,
defaultValue=5))
#self.addParameter(ParameterBoolean(
# self.DEBUG, self.tr('Print debugging information'), False))
self.addParameter(
QgsProcessingParameterString(
self.EXTRA,
self.tr('Additional creation parameters'),
'',
optional=True))

# advanced raster params
options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -191,10 +180,6 @@ def commandName(self):

def getConsoleCommands(self, parameters, context, feedback, executing=True):
out = self.parameterAsOutputLayer(parameters, self.OUTPUT, context)
extra = self.parameterAsString(parameters, self.EXTRA, context)
# if extra is not None:
# extra = str(extra)
#debug = self.getParameterValue(parameters, self.DEBUG)
formula = self.parameterAsString(parameters, self.FORMULA, context)
if self.NO_DATA in parameters and parameters[self.NO_DATA] is not None:
noData = self.parameterAsDouble(parameters, self.NO_DATA, context)
@@ -210,10 +195,6 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
if noData is not None:
arguments.append('--NoDataValue')
arguments.append(noData)
if extra and len(extra) > 0:
arguments.append(extra)
#if debug:
# arguments.append('--debug')
layer = self.parameterAsRasterLayer(parameters, self.INPUT_A, context)
if layer is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_A))
@@ -101,7 +101,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -91,7 +91,7 @@ def initAlgorithm(self, config=None):
self.addParameter(nodata_out_param)

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -67,7 +67,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -102,7 +102,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -107,7 +107,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -111,7 +111,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setMetadata({
@@ -63,7 +63,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -78,7 +78,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -62,7 +62,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -76,7 +76,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -61,7 +61,7 @@ def initAlgorithm(self, config=None):
defaultValue=False))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -104,7 +104,7 @@ def initAlgorithm(self, config=None):
optional=True))

options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
self.tr('Additional creation options'),
defaultValue='',
optional=True)
options_param.setFlags(options_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -649,7 +649,6 @@ def testGdalCalc(self):
'NO_DATA': None,
'BAND_F': -1,
'BAND_B': -1,
'EXTRA': '',
'RTYPE': 5,
'INPUT_F': None,
'BAND_E': -1,
@@ -672,7 +671,6 @@ def testGdalCalc(self):
'NO_DATA': None,
'BAND_F': -1,
'BAND_B': -1,
'EXTRA': '',
'RTYPE': 5,
'INPUT_F': None,
'BAND_E': -1,

0 comments on commit f524460

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