# Create cumulative raster layer in QGIS

I need to create a new raster layer with cumulative values for 16 raster layers. For context, each raster layer represents an 'areas burnt' in a given year - essentially, I want a new layer that tells me how many times each area has been burnt using a colour e.g. white is never burnt, light yellow is burnt once, darker yellow burnt twice… etc.)

I have been told I can use the raster calculator to do this, however when I add the layers together I am (unsurprisingly) left with a raster that only covers where each raster layer overlaps. Is there a way to get around this?

I actually also have a polygon layer for each raster layer, in case someone has a solution using the polygons. I converted the polygons to raster because the polygons are quite complicated, and I was told this would make it tricky. Screenshot of a section of the polygons below for context:

Set the 'burnt' area of each of your 16 rasters equal to 1 and use r.null on each of your rasters to convert 'nodata' values to 0.

To use r.null, set "The value to replace the null value by [optional]" to 0 and set the "GRASS GIS 7 region extent" to anything larger than the total extent of all 16 rasters.

Then use raster calculator to add all 16 layers. The band value in the output from raster calculator should equal the number of times that area has been burnt.

• This is an excellent answer that does exactly what I want. But alas, I am so new to QGIS there is some assumed knowledge that I do not have and so I am unable to enact the solution. Can you please clarify (1) how to change the raster value to 1, (2) were to find r.null function? Also unsure how to determine the total extend of all 16 raster points to be able to set the region extend value appropriately. Thank you for your patience. Aug 13, 2019 at 13:51
• (1) If you need to change the raster value to 1, use the raster calculator with the expression below. This example assumes your raster is called 'Raster' and the current value is 50. Edit as appropriate for you file. ("Raster@1" = 50) = 1 (2) Select "Processing" > "Toolbox" and search for "r.null" you should find it. Double-click to open the tool window. (3) You can find the overall extent of your 16 rasters by switching them all on, hovering your mouse at the bottom-left/top-right corners and noting the coordinates displayed at the bottom of your window. Aug 13, 2019 at 14:57

If all you need to do is visually represent "number of times an area has been burnt", there's a very simple solution with the polygon layer(s)

Simply make the polygon layers all the same color, and set their opacity to 30-50%. The more overlapping polygons, the darker they appear.

Here's what a layer looks like at 30% opacity.