3

I am working with QGIS to compute the annual burned area of my study area in Chile. I have two different layers.

  • One polygon layer which is a 1km x 1km grid of my study area. The only information this layer contains is a unique "id" for every grid cell.
  • The second layer is a point layer of fires. It contains information about the size, direction and duration of the fire. Every point is one fire. Multiple points (fires) can lie within a grid cell.

I now want to compute the average size of fires in each grid cell. How can that be accomplished?

2
  • Step 1: Tell us which software you're working with.
    – Erik
    Commented Nov 1, 2021 at 14:38
  • @Erik I edited the question. Commented Nov 1, 2021 at 14:54

1 Answer 1

3

This is an example trying to mimic your situation. Please modify layernames and field names according to your project.

enter image description here

Above figure shows two layers: Fire point layer with size field, and Grid layer with id field only.

Start Field Calculator on the Grid layer, and give this expression:

array_mean(overlay_contains('Fire', expression:= "size"))

enter image description here

It will return averaged fire size. (It returns null where you do not have any fire).

enter image description here

1
  • Thank you. I found another way which is way more time consuming. That saves me a lot of time. A hint for other people: array_mean is only avabile since QGis 3.18. Commented Nov 2, 2021 at 15:19

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.