Skip to content

Commit

Permalink
[processing][saga] Fix misleading 'layer could not be generated' error
Browse files Browse the repository at this point in the history
after running algorithms which create raster files

(cherry picked from commit 286fd20)
  • Loading branch information
nyalldawson committed Apr 17, 2021
1 parent 9d81c60 commit ce44e3e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/plugins/processing/algs/saga/SagaAlgorithm.py
Expand Up @@ -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
Expand Down

0 comments on commit ce44e3e

Please sign in to comment.