# QGIS Weighted Overlap

I have one Polygon-Layer with land-parcels and one Polygon-Layer with buildings. With the Overlap-Tool I can easily calculate, what area of each parcel is covered by one or more buildings.

But I need to calculate, how much living-area was built on each parcel. The living-area per parcel may be part of several buildings. And the buildings may stand on several parcels. In this case I assume that the living-area per parcel ist proportional to the part on each parcel (thats why overlapping comes into play).

So my idea was to calculate the overlap of the building-layer over the parcel-layer but somehow weighted by the attribute "living-area".

So e.g. parcel A includes 100% of building 1 with 100sqm living-area but only 50% of building 2 with 200sqm living-area. So the total living-area on parcel A is 200sqm.

So how can I calculate the living-area per parcel with QGIS?

• Welcome to GIS SE. As a new user, please take the Tour. Your Question does not contain a question, so it's difficult to tell what you are asking. Questions should always be able to answer the questions "What have you tried?" and "Where are you stuck?" A screenshot or other graphic might help explain your task. Aug 20, 2022 at 9:40
• Have you looked at the Overlap Analysis tool in Vector Analysis? In any case if your parcels and buildings have unique IDs and a calculated area field, after you've run your union overlay and calculated post overlay areas in another field, you can dump the data into a spreadsheet pivot table and work from there.
– John
Aug 20, 2022 at 13:48

You can use SQL and create a virtual layer:

It intersects the parcel and buildings, calculate the intersection area / parcel area and use the ratio to weigh the livingareas.

Replace the layer and fieldnames:

``````select  parcelid,
coalesce(sum( livingarea * st_area(st_intersection(parcelgeom, buildinggeom)) / st_area(buildinggeom) ), 0) as total_livingarea,
parcelgeom

from
(select id_0 as parcelid, geometry as parcelgeom from parcel) p
left join
(select id as buildingid, livingarea, st_area(geometry) as buildingarea, geometry as buildinggeom from building) b
on (st_intersects(parcelgeom, buildinggeom))

group by parcelid, parcelgeom
``````

Bottom right building has a living area of 1541, the grey parcel get 997 of it: