Skip to content
Permalink
Browse files
Merge branch 'processing-r.stat'
  • Loading branch information
alexbruy committed May 27, 2015
2 parents c729a75 + 596b126 commit d40c7631271895e7bbc41a21c2272d0d7cf8698b
Showing with 19 additions and 2 deletions.
  1. +19 −2 python/plugins/processing/algs/grass7/Grass7Algorithm.py
@@ -361,10 +361,24 @@ def processAlgorithm(self, progress):
commands.append('g.region raster=' + out.name + uniqueSufix)
outputCommands.append('g.region raster=' + out.name
+ uniqueSufix)
if self.grass7Name == 'r.composite':

if self.grassName == 'r.statistics':
# r.statistics saves its results in a non-qgis compatible
# way. Post-process them with r.mapcalc.
calcExpression = 'correctedoutput' + uniqueSufix
calcExpression += '=@' + out.name + uniqueSufix
command = 'r.mapcalc expression="' + calcExpression + '"'
commands.append(command)
outputCommands.append(command)

command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
command += ' input='
command += out.name + uniqueSufix
command += 'correctedoutput' + uniqueSufix
command += ' output="' + filename + '"'
elif self.grass7Name == 'r.composite':
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
command += ' input='
command += 'correctedoutput' + uniqueSufix
command += ' output="' + filename + '"'
else:
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
@@ -375,6 +389,9 @@ def processAlgorithm(self, progress):
elif self.grass7Name == 'r.composite':
commands.append(command)
outputCommands.append(command)
elif self.grass7Name == 'r.statistics':
commands.append(command)
outputCommands.append(command)
else:
command += out.name + uniqueSufix
command += ' output="' + filename + '"'

0 comments on commit d40c763

Please sign in to comment.