@@ -361,10 +361,24 @@ def processAlgorithm(self, progress):
361
361
commands .append ('g.region raster=' + out .name + uniqueSufix )
362
362
outputCommands .append ('g.region raster=' + out .name
363
363
+ uniqueSufix )
364
- if self .grass7Name == 'r.composite' :
364
+
365
+ if self .grassName == 'r.statistics' :
366
+ # r.statistics saves its results in a non-qgis compatible
367
+ # way. Post-process them with r.mapcalc.
368
+ calcExpression = 'correctedoutput' + uniqueSufix
369
+ calcExpression += '=@' + out .name + uniqueSufix
370
+ command = 'r.mapcalc expression="' + calcExpression + '"'
371
+ commands .append (command )
372
+ outputCommands .append (command )
373
+
365
374
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
366
375
command += ' input='
367
- command += out .name + uniqueSufix
376
+ command += 'correctedoutput' + uniqueSufix
377
+ command += ' output="' + filename + '"'
378
+ elif self .grass7Name == 'r.composite' :
379
+ command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
380
+ command += ' input='
381
+ command += 'correctedoutput' + uniqueSufix
368
382
command += ' output="' + filename + '"'
369
383
else :
370
384
command = 'r.out.gdal -c createopt="TFW=YES,COMPRESS=LZW"'
@@ -375,6 +389,9 @@ def processAlgorithm(self, progress):
375
389
elif self .grass7Name == 'r.composite' :
376
390
commands .append (command )
377
391
outputCommands .append (command )
392
+ elif self .grass7Name == 'r.statistics' :
393
+ commands .append (command )
394
+ outputCommands .append (command )
378
395
else :
379
396
command += out .name + uniqueSufix
380
397
command += ' output="' + filename + '"'
0 commit comments