TransWikia.com

Calculate multiple bands average raster in QGIS with high number of bands

Geographic Information Systems Asked on July 2, 2021

I am a new user of raster layers in QGIS.

I need to generate a new raster file with the average value for each pixel, from a raster file with 600 bands. The average has to be calculated from all the 600 bands, for each pixel.

The Raster Calculator only allows to add one band at a time, that would mean too much time and a risky process, considering that I have several similar raster layers that I have to work with.

Is there a way to add multiple bands at the same time in Raster Calculator in order to calculate it? Otherwise, is there another way to do it?

I tried also with RASS r.series but the output does not seem to be what I need, the layer is not shown in the canvas and the values are not what I expect to be (the data is about temperature)

min and max layer values

One Answer

In case someone faces the same situation, I solved it generating the calculation expression with Excel and Word. I had to make a sum of each of 600 bands from the same layer. First, with Excel:

Column A: make 600 rows with the same layer name.

Column B: make a column with the band's numbers (from 1 to 600)

Column C: Concatenate columns A and B

enter image description here

The " symbol at the beginning and the @ at the end of the layer name, as well as the " and + symbols at the end of the concat function are necessary in order to identifying the bands and summing them, in Qgis.

Then, in Word

1) Paste the generated rows in a new document

2) Search and replace the full stops after each band with a space or with nothing.

3) Delete the last + symbol in the last band.

Back In Qgis Raster Calculator, paste the whole expression.

Answered by Filippo on July 2, 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