1

I am trying to use Ordered weighted averaging to sum up values across different raster overlays in QGIS 3.4.4, but I get this error:

Traceback (most recent call last):

File "C:/PROGRA~1/QGIS3~1.4/apps/qgis/./python/plugins\processing\algs\saga\SagaAlgorithm.py",
line 217, in processAlgorithm
files.append(parameters[param.name()].source()[:-4] + 'sgrd')
AttributeError: 'list' object has no attribute 'source'

I have already tried to use Raster Calculator by SAGA, Raster analysis and GDAL, and GRASS' r.series, but either get an error or get a blank map. I have selected no-data value for 1 layer only, so I should get a result even if the areas don't overlap.

1

At least in GRASS, the r.series module propagates NULLs only if you add the -n flag. But you should be aware that in GRASS you must set the computational region to cover all rasters. So if you're trying to get the weighted average of rasters rast1, rast2 rast3, with weights 0.1, 0.2, 0.3, then:

RAST_LIST=`g.list rast pattern=rast*`
g.region -p input=$RAST_LIST 
r.series input=$RAST_LIST output=rast_avg weights=0.1,0.2,0.3 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.