Commit f5aff828 authored by Rashad Kanavath's avatar Rashad Kanavath

fix multiple input values

parent d257860a
......@@ -250,22 +250,21 @@ class OTBAlgorithm(QgsProcessingAlgorithm):
otb_cli_file = OTBUtils.OTB_CLI_FILE
command = OTBUtils.OTB_CLI_FILE + ' ' + self.name() + ' ' + OTBUtils.appFolder()
for k, v in parameters.items():
if k == 'outputpixeltype':
if k == 'outputpixeltype' or not v:
continue
if isinstance(v, list):
values = []
value = ''
for i in v:
values.append(self.get_value(i))
value = ','.join(values)
value += '"{}" '.format(self.get_value(i))
else:
value = self.get_value(v)
value = '"{}"'.format(self.get_value(v))
if k == output_key and 'outputpixeltype' in parameters:
value = value + ' ' + self.pixelTypes[int(parameters['outputpixeltype'])]
output_pixel_type = self.pixelTypes[int(parameters['outputpixeltype'])]
value = '"{}" "{}"'.format(value, output_pixel_type)
command += ' -{} "{}"'.format(k, value)
command += ' -{} {}'.format(k, value)
QgsMessageLog.logMessage(self.tr('cmd={}'.format(command)), self.tr('Processing'), Qgis.Critical)
if not os.path.exists(otb_cli_file) or not os.path.isfile(otb_cli_file):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment