I've already asked this question, but I didn't really get the answer I was expecting. I will then try to reformulate with added details: I am in the process of migrating an entire orchard mapping project from Manifold to QGIS. Manifold has been scripted (using VB) in a way that at the bottom of each map it has generated, it will calculate and display the total canopy area of the orchard with a breakdown per variety (see image below).
I want to replicate this with QGIS.
From my understanding, there are 3 fields in the attributes table of my polygon shapefile layer that could be useful:
- KPIN: every orchard has his own KPIN number. An orchard is subdivided by blocks and each block that grows a different variety of fruit will have the same KPIN number as the orchard where it belongs.
- Canopy area: this field will calculate (with the $area expression) the surface area of our blocks (polygons).
- Variety: this field defines what variety is being grown within our blocks
I believe there should be an expression that could use the KPIN number to pull data from the attribute tables and get what I would like to achieve:
- the total sum of the canopy area for my KPIN (orchard)
- a breakdown of the canopy areas per variety that is grown within the orchard
What this expression would look like? And where should I insert my expression? Is it in the print composer, in a label?