3

I have 52 weekly raster layers in QGIS. How can I get a mean annual raster layer from these 52?

The Raster calculator will do this but as its operators are all basic maths ones it will be a little longwinded. Is there a better/simpler way?

2 Answers 2

5

Starting from QGIS 3.16 you can perform cell-based statistics natively using Cell Statistics tool. For your case, you can use Mean cells as a statistic method to calculate the mean of all 52 rasters.

enter image description here

3

There is a GRASS GIS tool r.series in the Processing Toolbox.

QGIS 2.18.18 Interface:

enter image description here

  1. Start r.series
  2. Select all layers (or select required layers)
  3. Check 'Propagate NULLs' if you have NoData in your rasters
  4. Select average
5
  • thanks @Kazuhito that was easy to follow, BUT it fails: "line 395, in processAlgorithm if isinstance(out, QgsProcessingOutputHtml): NameError: name QgsProcessingOutputHtml' is not defined". I am using QGIS 3.01
    – Goomer
    Commented Apr 18, 2018 at 20:48
  • line 395, in processAlgorithm if isinstance(out, QgsProcessingOutputHtml): NameError: name QgsProcessingOutputHtml' is not defined
    – Goomer
    Commented Apr 18, 2018 at 20:51
  • 1
    Thanks @Goomer I cannot reproduce that error myself, but it may be related to this post Error running r.thin in QGIS. Does the process give you the output?
    – Kazuhito
    Commented Apr 18, 2018 at 21:00
  • looks like something is broken in the installation. I get the same error with all of the raster GRASS tools I have tried so far. I reinstalled QGIS but still get the same error.
    – Goomer
    Commented Apr 18, 2018 at 21:51
  • 1
    Seems it is a bug in 3.01: osgeo-org.1560.x6.nabble.com/…
    – Goomer
    Commented Apr 18, 2018 at 21:58

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.