Skip to content
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,, 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
if v == '' or v is None:
# for 'outputpixeltype' parameter we find the pixeltype string from self.pixelTypes
if k == 'outputpixeltype':
@@ -64,3 +64,19 @@ tests:
hash: 987b1488daaa16d09ad6f40039ee85101c557354a4d821d3f31ad235
type: rasterhash

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

0 comments on commit 6c2b26e

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