I'm trying to do a spatial analysis on a neighbourhood and I want to tally all the parcels in that neighbourhood according to land use classifications. However, the land use classifications on the data are way more granular than what I need, so I've basically spent time grouping them into broader categories that are styled in QGIS using rule-based classification.

For a report, I'd like to generate a diagram (pie chart) for the entire neighbourhood, using the rule based symbology I've developed to show what percentage of the total neighbourhood's land is associated with each rule based legend item. I envision having just one pie chart that shows the percentage of total land area that is represented by my custom rule based legend items.

I'm new to the diagramming features, but it seems that I am limited to developing a pie chart for every parcel within the neighbourhood, as opposed to developing a pie chart for the whole neighbourhood. I'm also limited to using the classifications that are on the underlying dataset, as opposed to the custom rule based groups that I have created.

Is there any foreseen way to achieve this by calculating it based on the rule based legend symbols as opposed to database columns? And can I just get one pie chart for the whole neighbourhood?

land use map rule based classificaton
pie charts for every parcel, only 1 desired

  • 1
    Id suggest using virtual layers for this. You could calculate the total area for each class and group this in a virtual layer e.g. use something like Select type, sum(st_area(geometry)) from landuse group by type as base. Then apply a diagram on this virtual layer. I am not aware of a possibility to use rule based symbology template for diagrams.
    – MrXsquared
    Oct 4, 2019 at 16:37
  • Or try the field calculator functions that come packaged in the RefFunctions plugin. Use intersecting_geom_sum to calculate the sum of each land use type that intersects each neighborhood feature.
    – csk
    Oct 8, 2019 at 4:36


Your Answer

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

Browse other questions tagged or ask your own question.