1

I have a polygon layer in QGIS (building outlines) and I made a grid over this layer using the MMQGIS function. I want to calculate the area of the building outlines in each grid cell (so it becomes another column in the grid cell layer).

Any ideas?

It's all in vector.

1 Answer 1

1

Use this expression on the grid layer and replace building_layer_name with the name of your layer containing the polygons of the buildings:

    area ( 
        intersection (
            $geometry, 
            collect_geometries (overlay_intersects ('building_layer_name',$geometry))
        )
    )

The expression used on the grid layer to create a label, indicating the area each cell overlaps with the building (2x2 m grid):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.