1

I have 36 TIFF rasters for the same spot, overlapping 100% and having the same dimension.

My goal is to create a result raster where each pixel represents the number of values where a condition is fullfilled. For example using count, if value >= 5 then the algorithm should check the same pixel in each layer of the 36 rasters; then writes it. min should be 0 if no condition is fullfiled and maximum should be 36 if all layers fullfill the condition at same pixel.

Is there such algorithm or tool to do it in QGIS? I am using QGIS 3.28.

1 Answer 1

2

In Raster > Raster calculator, use the following formula:

("Raster1@1">5)  +  ("Raster2@1">5) + ... +  ("Raster36@1">5)

This will return a value between 0 and 36 for each pixel, with a contribution of 1 every time the condition is met on one raster's pixel.

Notes:

  • Make sure to select all the raster layers before launching the Raster Calculator if you want them to appear in the Raster Bands
  • Parenthesis are important otherwise it returns no result.

enter image description here

1
  • Thank you so much, that is a great idea!
    – Khaled
    Commented Jan 26, 2023 at 17:04

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.