3

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

1

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.

  • I correct myself, there is no need to do the Word steps. You can paste directly the Excell cells from the CONCAT column to the raster calculator. – Filippo Oct 29 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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