Project: population, area and density by zone
A complete exercise with the ward layer. Summarise population and area by zone, compute the density of each zone, map it, and export the summary table as CSV.
You will learn
- Plan a small analysis from question to result.
- Combine aggregation with a calculated field.
- Present and export the result.
Data for this tutorial
Wards (synthetic) Download wards.geojson
- Format
- GeoJSON
- Geometry
- Polygon
- CRS
- EPSG:32643 (WGS 84 / UTM zone 43N)
- Content
- 84 wards (31 peri-urban, 19 rural, 34 urban), 333,497 residents
- In Orbis
- Browser panel ▸ Tutorial sample data (synthetic) ▸ Wards, or Load complete tutorial pack.
Fields used in the tutorials
| Field | Type | Description |
|---|---|---|
ward_id | text | Ward code W01 to W84. |
ward_name | text | Ward name. |
zone | text | urban, peri-urban or rural. |
population | integer | Residents. |
households | integer | Households. |
area_km2 | real | Ellipsoidal area in km². |
density_km2 | real | Persons per km². |
literacy_rate | real | Literate share, per cent. |
Licence: CC0 1.0. All tutorial data is synthetic and generated by Orbis. About the datasets
The task
The planning office asks three questions about the tutorial district: how many people live in each zone (urban, peri-urban, rural), how much land each zone covers, and how densely each is populated. You will answer them with the Wards layer and produce a table and a map.
Steps
1. Explore the data
- Add Wards from Browser ▸ Tutorial sample data (synthetic) and open its attribute table (F6). There are 84 wards with
zone,populationandarea_km2.
- Right-click the
zoneheader and choose Field statistics & unique values: three zones, no empty values.
2. Summarise by zone
Click Group and summarize in the table toolbar. Tick zone under Group by fields and set up four aggregates:
Function Field Output name Count records wardsSum populationpopulationSum area_km2area_km2Average (mean) literacy_ratemean_literacy
The aggregates for the zone summary.
- Click Run. The table Summary by zone (Wards (synthetic)) opens.
3. Density and map
- The density of a zone is its summed population divided by its summed area; work it out from the summary table (see the last column below).
- To map density, open the Field calculator on the wards, enter
densityas Result field name, choose Decimal number (real) and the expression"population" / "area_km2". Style the wards bydensitywith Graduated classes.
- Export the summary with Export… in the attribute table as CSV (UTF-8).
Expected result
| zone | wards | population | area_km2 | mean_literacy | persons per km² |
|---|---|---|---|---|---|
| peri-urban | 31 | 94,952 | 42.086 | 67.5 | 2,256 |
| rural | 19 | 24,200 | 40.969 | 62.1 | 591 |
| urban | 34 | 214,345 | 22.038 | 81.9 | 9,726 |
Together 333,497 residents on 105.09 km². The urban zone has 21 % of the land and 64 % of the residents.
Common mistakes
- Averaging densities. The mean of the ward densities is not the zone density, because wards differ in size. Divide the summed population by the summed area.
- Averaging rates without weights. The mean literacy above is the mean of ward rates, not the literacy of all residents; for the latter, weight by population.
Troubleshooting
- Different totals. Check that no wards are selected with Selected features only ticked, and that no filter is set under Only records where.
- Area in the wrong unit.
area_km2is stored in km². To recompute areas, use Calculate area with Square kilometres.