Skip to content
Permalink
Browse files
[processing][saga] Fix misleading 'layer could not be generated' error
after running algorithms which create raster files

(cherry picked from commit 286fd20)
  • Loading branch information
nyalldawson committed Apr 17, 2021
1 parent 9d81c60 commit ce44e3e9c221b0297d8b86f5fac608e64fa4a4e3
Showing with 5 additions and 5 deletions.
  1. +5 −5 python/plugins/processing/algs/saga/SagaAlgorithm.py
@@ -328,11 +328,11 @@ def processAlgorithm(self, parameters, context, feedback):

# special treatment for RGB algorithm
# TODO: improve this and put this code somewhere else
for out in self.destinationParameterDefinitions():
if isinstance(out, QgsProcessingParameterRasterDestination):
filename = self.parameterAsOutputLayer(parameters, out.name(), context)
filename2 = os.path.splitext(filename)[0] + '.sgrd'
if self.cmdname == 'RGB Composite':
if self.cmdname == 'RGB Composite':
for out in self.destinationParameterDefinitions():
if isinstance(out, QgsProcessingParameterRasterDestination):
filename = self.parameterAsOutputLayer(parameters, out.name(), context)
filename2 = os.path.splitext(filename)[0] + '.sgrd'
commands.append('io_grid_image 0 -COLOURING 4 -GRID:"{}" -FILE:"{}"'.format(filename2, filename))

# 3: Run SAGA

0 comments on commit ce44e3e

Please sign in to comment.