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
  • Loading branch information
nyalldawson committed Mar 25, 2021
1 parent c167cfb commit 7c538c4
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 7c538c4

Please sign in to comment.