[Qgis-user] Raster calculator: different extents and nodata

Michael.Scholz at dlr.de Michael.Scholz at dlr.de
Tue Feb 24 09:21:09 PST 2015


Hey!
In QGIS 2.6.1 I spent the whole day on the raster calculator for some super-simple overlay calculations and I'm ending up in rage and fury. I don't want to complain about the unintuitive syntax. Rather I have some questions:
1) I have two raster with different extents. rasterA entirely contains rasterB. When I add these rasters (rasterA + rasterB) and set the output extent to the same as of rasterA, my result is only defined at the overlapping area of both rasters. In this case all cells outside the extent of rasterB get assigned "nodata" which is the default -3.4028234663852886e+38 in my case. Is that correct?
2) I extended rasterB to have the same extent as rasterA by filling the missing cells with "nodata". rasterA + rasterB still gives the same result as in 1). Why is "rasterA + nodata = nodata"? I just want values from rasterB to be added to values of rasterA AND keeping rasterA entirely where rasterB has no values.
3) How can I query the "nodata" value of a band?? Without being able to query it, I cannot set it to 0 which would solve all my problems.
4) I would like to express something like "(rasterB = nodata AND rasterA != nodata) * rasterA + (rasterB != nodata) * (rasterA + rasterB)". Is that possible?

Still in love with QGIS
Michi Scholz



More information about the Qgis-user mailing list