Skip to content
Permalink
Browse files

[processing] use full precision for elevation values

remove unused file
  • Loading branch information
alexbruy committed Dec 19, 2016
1 parent c3e3ba6 commit f4f86cad63404a44064a4068ec5446bd4b78a1a7
@@ -75,6 +75,10 @@ def setValue(self, value):
self.value = None
return True

if value == '':
if not self.optional:
return False

if isinstance(value, str):
self.value = value if value != '' else None
else:
@@ -100,11 +104,11 @@ def fromScriptCode(self, line):
def colorsToString(colors):
s = ''
for c in colors:
s += '{:.2f}, {:.2f}, {:d}, {:d}, {:d};'.format(c[0],
c[1],
c[2],
c[3],
c[4])
s += '{:f}, {:f}, {:d}, {:d}, {:d};'.format(c[0],
c[1],
c[2],
c[3],
c[4])
return s[:-1]

self.addParameter(ParameterRaster(self.INPUT_LAYER,

This file was deleted.

@@ -239,11 +239,11 @@ def value(self):
rColors = self.reliefColors()
colors = ''
for c in rColors:
colors += '{:.2f}, {:.2f}, {:d}, {:d}, {:d};'.format(c.minElevation,
c.maxElevation,
c.color.red(),
c.color.green(),
c.color.blue())
colors += '{:f}, {:f}, {:d}, {:d}, {:d};'.format(c.minElevation,
c.maxElevation,
c.color.red(),
c.color.green(),
c.color.blue())
return colors[:-1]


@@ -1153,17 +1153,18 @@ tests:
name: Relief (custom colors)
params:
AUTO_COLORS: false
COLORS: 85.00, 104.44, 7, 165, 144;104.44, 104.44, 12, 221, 162;104.44, 104.44,
33, 252, 183;104.44, 104.44, 247, 252, 152;104.44, 104.44, 252, 196, 8;104.44,
190.33, 252, 166, 15;190.33, 226.70, 175, 101, 15;226.70, 226.70, 255, 133,
92;226.70, 243.00, 204, 204, 204
COLORS: 85.000000, 104.436508, 7, 165, 144;104.436508, 104.436508, 12, 221, 162;104.436508,
104.436508, 33, 252, 183;104.436508, 104.436508, 247, 252, 152;104.436508, 104.436508,
252, 196, 8;104.436508, 190.333333, 252, 166, 15;190.333333, 226.698413, 175,
101, 15;226.698413, 226.698413, 255, 133, 92;226.698413, 243.000000, 204, 204,
204
INPUT_LAYER:
name: dem.tif
type: raster
Z_FACTOR: 1.0
results:
OUTPUT_LAYER:
hash: 6c79ec9b948c8e878aa490670e8a26a0b6efc5f9d162a0fff1042d80
hash: 7fe0e0174185fd743e23760f33615adf10f771b4275f320db6f7f4f8
type: rasterhash

# Case 1: Keep all fields

0 comments on commit f4f86ca

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