1

I am using grass plugin in qgis 2.12. I have to estimate the average value of all the pixels but don't know how to do it.

1

Assuming that you know how to handle your Mapset and populate it with raster maps, you can use a combination of r.sum and r.report modules.

After Open your Mapset with the GRASS Tool, at the Statistics section of r.modules (filtered them with r.), you can observe both (see next image).

enter image description here

At the next image, you can see the output of r.sum for my particular raster dem. The value was 2424831264.000000.

enter image description here

Next result was obtained with r.report module and the "Cell counts" option. Its value was 1328880 (my raster has not NULL values). So, the average value of all pixels is 2424831264/1328880 = 1824.71800614.

enter image description here

For automating this process you have to use grass.script python module.

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.