TransWikia.com

How to calculate mean of raster layers where some layers have missing values (R or QGIS)?

Geographic Information Systems Asked by wpier on March 18, 2021

I am trying to create annual averages of some raster layers, but 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 working with rasters, and any guidance on how to solve this problem would be appreciated! Happy for solutions that work in QGIS or R.

One Answer

This is your decision. 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.

Answered by Urban87 on March 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP