Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing][gdal] color relief alg: add the default color option, i.…
…e., no switches
  • Loading branch information
ajolma authored and nyalldawson committed Mar 11, 2018
1 parent 8df954d commit 08332e7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/gdal/ColorRelief.py
Expand Up @@ -54,7 +54,8 @@ def __init__(self):

def initAlgorithm(self, config=None):
self.modes = ((self.tr('Use strict color matching'), '-exact_color_entry'),
(self.tr('Use closest RGBA quadruplet'), '-nearest_color_entry'))
(self.tr('Use closest RGBA quadruplet'), '-nearest_color_entry'),
(self.tr('Use smoothly blended colors'), ''))

self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
self.tr('Input layer')))
Expand All @@ -69,7 +70,7 @@ def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterEnum(self.MATCH_MODE,
self.tr('Matching mode'),
options=[i[0] for i in self.modes],
defaultValue=0))
defaultValue=2))
options_param = QgsProcessingParameterString(self.OPTIONS,
self.tr('Additional creation parameters'),
defaultValue='',
Expand Down
18 changes: 18 additions & 0 deletions python/plugins/processing/tests/testdata/gdal_algorithm_tests.yaml
Expand Up @@ -68,6 +68,24 @@ tests:
hash: 4f4720e4efe59a7f238f622659917bbeb5262369d15d5e2917dbcf8b
type: rasterhash

- algorithm: gdal:colorrelief
name: Color relief (gdaldem)
params:
BAND: 1
COLOR_TABLE:
name: custom/color_relief.txt
type: file
COMPUTE_EDGES: false
INPUT:
name: dem.tif
type: raster
MATCH_MODE: 2
OPTIONS: ''
results:
OUTPUT:
hash: f714597fadc9cfc3f5263dc0e35f7c6ba285de238dce439e4988faac
type: rasterhash

- algorithm: gdal:colorrelief
name: Color relief (gdaldem)
params:
Expand Down

0 comments on commit 08332e7

Please sign in to comment.