I'm working on Qgis 3.8 , I have a mold filled with squares, I would like to burn the average value within each square of other vector or raster file. Mold

This is the vectoriced file with all the data that I want to burn in those squares


This is the original raster file Raster

In the past I have done it (this isn't the final file, it's similar to how it should look), but now I can't remember how, neihter find the post that helped me with that. enter image description here

Lowering the resolution of the raster file won't be usefull, because I am comparing different rasterfiles that have to have the same resolution and squares with data and without data in order to be compared in R Studio.

1 Answer 1


You can use Zonal Statistics tool to calculate the average raster cells within polygon grid. Just search for Zonal Statistics and you will find it as in the image below.

enter image description here

  • 1
    If you have multiple rasters, you can still use this method. Just run Zonal Stats once for each raster, so that it builds up new fields on the same vector layer. Then use the Field Calculator to calculate the average of all the fields. If you add the "count" stat as well as the mean, you can calculate a weighted average.
    – csk
    Oct 1, 2019 at 18:20

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.