Practical GIS projects

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.

Intermediate2 min read

You will learn

  • Plan a small analysis from question to result.
  • Combine aggregation with a calculated field.
  • Present and export the result.

Prerequisites

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
FieldTypeDescription
ward_idtextWard code W01 to W84.
ward_nametextWard name.
zonetexturban, peri-urban or rural.
populationintegerResidents.
householdsintegerHouseholds.
area_km2realEllipsoidal area in km².
density_km2realPersons per km².
literacy_raterealLiterate 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

  1. Add Wards from Browser ▸ Tutorial sample data (synthetic) and open its attribute table (F6). There are 84 wards with zone, population and area_km2.
  1. Right-click the zone header and choose Field statistics & unique values: three zones, no empty values.

2. Summarise by zone

  1. Click Group and summarize in the table toolbar. Tick zone under Group by fields and set up four aggregates:

    FunctionFieldOutput name
    Count recordswards
    Sumpopulationpopulation
    Sumarea_km2area_km2
    Average (mean)literacy_ratemean_literacy
    The Aggregate tool grouping wards by zone with count, sum of population, sum of area and mean literacy
    The aggregates for the zone summary.
  1. Click Run. The table Summary by zone (Wards (synthetic)) opens.

3. Density and map

  1. 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).
  1. To map density, open the Field calculator on the wards, enter density as Result field name, choose Decimal number (real) and the expression "population" / "area_km2". Style the wards by density with Graduated classes.
  1. Export the summary with Export… in the attribute table as CSV (UTF-8).

Expected result

zonewardspopulationarea_km2mean_literacypersons per km²
peri-urban3194,95242.08667.52,256
rural1924,20040.96962.1591
urban34214,34522.03881.99,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_km2 is stored in km². To recompute areas, use Calculate area with Square kilometres.