Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] set default value for band parameters in GDAL algs (fix #…
…20610)

(cherry picked from commit 1e1ed79)
  • Loading branch information
alexbruy committed Jan 1, 2019
1 parent 7db8910 commit 4ff4b6f
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/ColorRelief.py
Expand Up @@ -62,6 +62,7 @@ def initAlgorithm(self, config=None):
self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.COMPUTE_EDGES,
self.tr('Compute edges'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/aspect.py
Expand Up @@ -59,6 +59,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.TRIG_ANGLE,
self.tr('Return trigonometric angle instead of azimuth'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/contour.py
Expand Up @@ -66,6 +66,7 @@ def initAlgorithm(self, config=None):
self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterNumber(self.INTERVAL,
self.tr('Interval between contour lines'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/fillnodata.py
Expand Up @@ -59,6 +59,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterNumber(self.DISTANCE,
self.tr('Maximum distance (in pixels) to search out for values to interpolate'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/gdal2xyz.py
Expand Up @@ -53,6 +53,7 @@ def initAlgorithm(self, config=None):
self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.CSV,
self.tr('Output comma-separated values'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/hillshade.py
Expand Up @@ -65,6 +65,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterNumber(self.Z_FACTOR,
self.tr('Z factor (vertical exaggeration)'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/pct2rgb.py
Expand Up @@ -57,6 +57,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.RGBA,
self.tr('Generate a RGBA file'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/polygonize.py
Expand Up @@ -59,6 +59,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterString(self.FIELD,
self.tr('Name of the field to create'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/proximity.py
Expand Up @@ -75,6 +75,7 @@ def initAlgorithm(self, config=None):
self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterString(self.VALUES,
self.tr('A list of pixel values in the source image to be considered target pixels'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/roughness.py
Expand Up @@ -57,6 +57,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.COMPUTE_EDGES,
self.tr('Compute edges'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/slope.py
Expand Up @@ -61,6 +61,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterNumber(self.SCALE,
self.tr('Ratio of vertical units to horizontal'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/tpi.py
Expand Up @@ -56,6 +56,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.COMPUTE_EDGES,
self.tr('Compute edges'),
Expand Down
1 change: 1 addition & 0 deletions python/plugins/processing/algs/gdal/tri.py
Expand Up @@ -55,6 +55,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT, self.tr('Input layer')))
self.addParameter(QgsProcessingParameterBand(self.BAND,
self.tr('Band number'),
1,
parentLayerParameterName=self.INPUT))
self.addParameter(QgsProcessingParameterBoolean(self.COMPUTE_EDGES,
self.tr('Compute edges'),
Expand Down

0 comments on commit 4ff4b6f

Please sign in to comment.