Skip to content

Commit 5b4fee8

Browse files
committed
Merge pull request #945 from gioman/grassrasterexport
[processing] fixes GRASS raster export in order to cope with r.horizon and r.composite
2 parents 16ac256 + 6406835 commit 5b4fee8

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

python/plugins/processing/grass/GrassAlgorithm.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,23 @@ def processAlgorithm(self, progress):
372372
commands.append('g.region rast=' + out.name + uniqueSufix)
373373
outputCommands.append('g.region rast=' + out.name
374374
+ uniqueSufix)
375-
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
376-
command += ' input='
377-
command += out.name + uniqueSufix
378-
command += ' output="' + filename + '"'
379-
commands.append(command)
380-
outputCommands.append(command)
375+
if self.grassName == 'r.composite':
376+
command = 'r.out.tiff -t --verbose'
377+
command += ' input='
378+
command += out.name + uniqueSufix
379+
command += ' output="' + filename + '"'
380+
commands.append(command)
381+
outputCommands.append(command)
382+
else:
383+
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
384+
command += ' input='
385+
if self.grassName == 'r.horizon':
386+
command += out.name + uniqueSufix + '_0'
387+
else:
388+
command += out.name + uniqueSufix
389+
command += ' output="' + filename + '"'
390+
commands.append(command)
391+
outputCommands.append(command)
381392

382393
if isinstance(out, OutputVector):
383394
filename = out.value

0 commit comments

Comments
 (0)