Skip to content
Permalink
Browse files

[OTB] Fixes empty string parameters (#40957)

(cherry picked from commit 579d55f)
  • Loading branch information
troopa81 authored and nyalldawson committed Jan 13, 2021
1 parent 3de1b34 commit 6c2b26ecaea85ae59278bcc0188b78311db53ba0
@@ -201,8 +201,8 @@ def processAlgorithm(self, parameters, context, feedback):
command = '"{}" {} {}'.format(app_launcher_path, self.name(), OtbUtils.appFolder())
outputPixelType = None
for k, v in parameters.items():
# if value is None for a parameter we don't have any businees with this key
if v is None:
# if value is None or en empty string for a parameter then we don't want to pass that value to OTB (see https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2130)
if v == '' or v is None:
continue
# for 'outputpixeltype' parameter we find the pixeltype string from self.pixelTypes
if k == 'outputpixeltype':
@@ -64,3 +64,19 @@ tests:
out:
hash: 987b1488daaa16d09ad6f40039ee85101c557354a4d821d3f31ad235
type: rasterhash

- algorithm: otb:Rasterization
name: Test empty string and zero integer parameters (otb:Rasterization)
params:
in:
name: polys.gml
type: file
epsg: EPSG:4326
spx: 1
spy: 1
mode.attribute.field: ""
outputpixeltype: 0
results:
out:
hash: c898326f9327dd0a111532fdacc5f43fc485ae3e10f1238b5da04dde
type: rasterhash

0 comments on commit 6c2b26e

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