How do I create annual averages of raster layers, if some of these layers have gaps in the data?

If all pixels in all of the layers contained info I would just use Raster Calculator and do (r1 + r2 + r3 +...)/n.

However, the number of layers including useful information for each pixel isn't the same across the rasters so I am not sure how to proceed.

I am very new to spatial analysis and to working with rasters in QGIS.

1 Answer 1


I think there are two ways.

  1. Calculate by interpolating the missing values.
  • The average is obtained from the corrected value.
  1. The mean is calculated only when each cell has a value other than Nodata.
  • If you use only the QGIS raster calculator, first classify the values of each raster as 1 and nodata=0.
  • Adds all rasters.
  • You will be able to extract areas of raster with overlapping values through raster values. (If there are 3 rasters, the possible values are 0-3.)
  • Select each area to make a mask and then calculate the value of the original data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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