# From Maps to Minutes — practice companion

Adaad, Methods Notebook, September 2026. Allow 15–20 minutes. No GIS required.

## Files and run order

1. Download `travel_time_tehsils.csv` from the article. Preserve the original.
2. Open it in a spreadsheet, or download `reproduce_summary.py` to the same folder.
3. For Python 3, run `python3 reproduce_summary.py travel_time_tehsils.csv`.
   It uses only the standard library; no packages or source rasters are needed.
4. Compare the results with the answer key below and write an interpretation.

The CSV is the existing frozen Adaad tehsil output. The script recombines that
table; it neither rebuilds the source rasters nor calculates routes to new destinations.

## Exercise

Retain positive `n_px` and `pop_2020`, with a recorded `mot_popw_mean`. Identify
the excluded row. Sum population. Multiply each population by its motorized
population-weighted mean, sum those products, and divide by total population.
Compare this with the simple average of the tehsil means.

For each row, multiply `pop_2020 * mot_pct_pop_gt60 / 100`. Sum to estimate people
beyond one hour. Divide by total population and multiply by 100 for the percentage.
Do not instead select tehsils whose mean exceeds 60 minutes: that loses the within-tehsil distribution.

In a spreadsheet, use `SUMPRODUCT(population_range, mean_range)/SUM(population_range)`
on the retained rows. Both ranges must cover the same rows and exclude headers.

Write one sentence reporting the mean, threshold share, population year and
travel scenario. Add a limitation that cannot be resolved from the CSV.

## Answer key

- 552 valid rows; Manora Cantonment excluded (no valid cells, not zero travel time).
- 1,175,119 valid cells; modelled 2020 population 219,576,102.
- Population-weighted motorized mean: 22.1034 minutes, reported as 22.10.
- Simple mean of the 552 tehsil population-weighted means: 68.8861 minutes.
- Mean across cells, weighting each cell mean by `n_px`: 203.6183 minutes.
- More than 60 minutes: about 16,359,114 modelled people, or 7.4503%.

These are approximate reconstructions from rounded published statistics. Report
about 16.36 million or 16.4 million people, not a precise person count.

Example: “Across the population represented by the 2020 grid, estimated motorized
travel time to the nearest mapped health facility averages 22.1 minutes; about
7.45% live more than an hour away.” The model cannot establish whether that
facility supplies the service a patient needs.

## Data dictionary

| Column | Meaning |
| --- | --- |
| dd_id | Boundary identifier; preserve as text. |
| tehsil | Tehsil name in the 2015 reporting frame. |
| district_key | District join key. |
| province | Reporting province or territory, including AJK and GB. |
| merged_district | 1 for a merged district within KP, otherwise 0. |
| n_px | Count of valid travel cells assigned to the tehsil; not a survey sample size. |
| pop_2020 | WorldPop 2020 population on those cells, rounded to a whole person. |
| mot_mean, wal_mean | Mean minutes across cells, motorized and walking scenarios. |
| mot_popw_mean, wal_popw_mean | Population-weighted mean minutes for each scenario. |
| mot_pct_pop_gt30, mot_pct_pop_gt60, mot_pct_pop_gt120 | Percent of population in cells strictly beyond 30, 60 and 120 motorized minutes. |
| wal_pct_pop_gt30, wal_pct_pop_gt60, wal_pct_pop_gt120 | Corresponding walking percentages. |

Blank statistics mean no estimate. Times and percentages are rounded to one
decimal. Percentages range from 0 to 100; divide by 100 before multiplying by population.

## Four-cell example (invented, equal-area cells)

| Cell | Minutes | People | Minutes × people |
| --- | ---: | ---: | ---: |
| A | 10 | 600 | 6000 |
| B | 20 | 300 | 6000 |
| C | 60 | 80 | 4800 |
| D | 120 | 20 | 2400 |

Cell mean = 210 / 4 = 52.5 minutes. Population mean = 19200 / 1000 = 19.2.
Strictly beyond 60 minutes = 2%; at least 60 minutes = 10%.
Combine A–B and C–D: population means 13⅓ and 72, populations 900 and 100.
Their simple average is 42⅔; combining with population weights recovers 19.2.

## What a full GIS rebuild additionally requires

Obtain the [MAP healthcare travel-time layers](https://malariaatlas.org/project-resources/accessibility-to-healthcare/),
the [WorldPop 2020 UN-adjusted population series](https://hub.worldpop.org/Global1_2000-2020),
and the matching Data Darbar boundary frame. Record exact input versions, coordinate
systems, grid alignment and extent. Align population to the travel grid; check
population conservation when resampling counts. Rasterise boundaries with an explicit
cell-assignment rule; create a common valid-cell mask; report missing zones, cell
counts and represented population before calculating weighted means and threshold shares.

The original Adaad build used nearest-neighbour population resampling and cell-centre
boundary assignment. Its separately rasterised district coverage has 1,179,790 cells
and 220,111,132 people, so its denominators differ from the tehsil output by 4,671
cells and 535,030 people. Differences are not solely rounding. Six Killa Saifullah
tehsils combine to 112.3 minutes; the district build gives 113.8.

For schools or courts, audit a new destination list and calculate a new least-cost
travel surface using a documented friction layer, connectivity and movement rules.
Do not reuse the healthcare travel raster as a school-access raster. This companion
provides a working CSV exercise, not a complete GIS rebuild or new-destination tutorial.

Suggested advanced task: choose one district and one clearly defined service type;
check destination coverage, duplicates and coordinates; compare results with unverified
locations excluded. Record the population affected and what local evidence could
distinguish between scenarios. Never interpret exact graph costs as measured journeys.
