Calculating regional statistics
Another classic spatial analysis task is calculating the areas of a certain type within regions, for example, the area within a county that is covered by certain land use types, or the share of different crops that is farmed in given municipalities.
In this recipe, we will calculate statistics of geological data for zip code areas. In particular, we will calculate the total area of each type of rock per zip code area.
Getting ready
To follow this recipe, load zipcodes_wake.shp
and geology.shp
from our sample data. Additionally, install and activate the Group Stats plugin using Plugin Manager.
How to do it…
Using the following steps, we can calculate the areas of certain rock types per zip code area:
Calculate the intersections between zip code areas and geological areas using the Intersection tool in the Processing Toolbox option or from the Vector menu.
Using the Group Stats plugin, you can now calculate the total area per rock type and zip code area, as follows...