In QGIS how can I get the difference between the areas of two layers through field calculator? And is there a way to automatize it so every time a new feature is added the difference updates?
- Layer 1 = Big polygon
- Layer 2 = small polygons inside polygon in layer 1
The "difference" field in this case would be an attribute of the Layer 1.
The area attribute in both layers are virtual fields ($area
)
I thought putting a code in the Default Value of the field in Attribute Form and check 'Apply default Value on update' but I just can't write the code, maybe something with aggregate?
The image bellow shows a schematic representation of what I'm trying to achieve: