Skip to content

Commit 08332e7

Browse files
ajolmanyalldawson
authored andcommittedMar 11, 2018
[processing][gdal] color relief alg: add the default color option, i.e., no switches
1 parent 8df954d commit 08332e7

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed
 

‎python/plugins/processing/algs/gdal/ColorRelief.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def __init__(self):
5454

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

5960
self.addParameter(QgsProcessingParameterRasterLayer(self.INPUT,
6061
self.tr('Input layer')))
@@ -69,7 +70,7 @@ def initAlgorithm(self, config=None):
6970
self.addParameter(QgsProcessingParameterEnum(self.MATCH_MODE,
7071
self.tr('Matching mode'),
7172
options=[i[0] for i in self.modes],
72-
defaultValue=0))
73+
defaultValue=2))
7374
options_param = QgsProcessingParameterString(self.OPTIONS,
7475
self.tr('Additional creation parameters'),
7576
defaultValue='',

‎python/plugins/processing/tests/testdata/gdal_algorithm_tests.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,24 @@ tests:
6868
hash: 4f4720e4efe59a7f238f622659917bbeb5262369d15d5e2917dbcf8b
6969
type: rasterhash
7070

71+
- algorithm: gdal:colorrelief
72+
name: Color relief (gdaldem)
73+
params:
74+
BAND: 1
75+
COLOR_TABLE:
76+
name: custom/color_relief.txt
77+
type: file
78+
COMPUTE_EDGES: false
79+
INPUT:
80+
name: dem.tif
81+
type: raster
82+
MATCH_MODE: 2
83+
OPTIONS: ''
84+
results:
85+
OUTPUT:
86+
hash: f714597fadc9cfc3f5263dc0e35f7c6ba285de238dce439e4988faac
87+
type: rasterhash
88+
7189
- algorithm: gdal:colorrelief
7290
name: Color relief (gdaldem)
7391
params:

0 commit comments

Comments
 (0)
Please sign in to comment.