Skip to content

#30DayMapChallenge Day 9: Urban-rural

Posted on:November 9, 2026 at 09:00 AM

Day 9 of the #30DayMapChallenge 2026.

Urban-rural — Urban or rural. Cities and countryside.

Instead of mapping the city and the countryside separately, I wanted to map the change from one to the other. So for Day 9 I asked MapAI to draw a single straight line from Sydney Town Hall to Lithgow, over the Blue Mountains, and tell me what happens along it: where does the city end, and where does the country begin?

MapAI showing SA2s along a straight white line from Sydney Town Hall to Lithgow, shaded by log population density from dark purple in the inner city to yellow in the Blue Mountains and around Lithgow

The prompt

Urban–rural transect: Sydney CBD to Lithgow.

  1. Draw a straight line from Sydney Town Hall west to Lithgow town centre.
  2. Select every SA2 (ASGS Edition 3) that the line passes through, and give each one its distance in km from Town Hall, measured along the line to where the line enters the SA2.
  3. For each of those SA2s, get: 2025 ABS ERP and population density (people per km²), median age and median weekly household income (2021 Census), and the Modified Monash Model class.

Output 2 layers:

  1. The transect SA2s as a choropleth of population density, using a log scale, dark for dense and light for sparse.
  2. The transect line as a thin white line.

Tooltips: SA2 name, distance from CBD (km), population density, median age, median household income, MMM class.

Tell me, in a table ordered by distance from the CBD: each SA2’s distance, density, median age, income and MMM class. Then tell me where the city ends (the first SA2 below 100 people per km²), where the MMM class first changes from metropolitan, and how age and income change from the CBD to Lithgow. List your assumptions.

A transect is an old idea from ecology and urban planning: walk a line across a landscape and record what changes. The line here is 103.34 km long and crosses 32 SA2s.

What MapAI found

What MapAI did

By the numbers, this map took:

Here is its evidence trail, in its own words where possible.

How it understood the question

The workflow

  1. Inspected the ABS dataflows for Edition 3 ERP and the 2021 Census medians.
  2. Fetched 2025 ERP and the 2021 Census measures for SA2s across the Sydney–Lithgow extent.
  3. Matched the 32 SA2s crossed by the transect and calculated each one’s entry distance from Town Hall.
  4. Assigned each SA2 an MMM class using the midpoint of its stretch of the line.
  5. Saved the SA2 choropleth and the white transect line.

The data

The SQL

The neat trick is how MapAI measured each SA2’s distance from the CBD. It found the points where the line crosses each SA2’s boundary, and used ST_LineLocatePoint to turn the first crossing into a fraction of the way along the line:

CASE
  WHEN ST_Covers (x.geometry, x.cbd) THEN 0.0
  ELSE (
    SELECT
      MIN(ST_LineLocatePoint (x.transect, d.geom))
    FROM
      ST_DumpPoints (ST_CollectionExtract (x.boundary_hits, 1)) d
  )
END AS entry_fraction

Multiply that fraction by the line’s 103.34 km, and you have the distance from Town Hall.

Gaps and uncertainties

MapAI flagged three:

You can explore the live map here: 09 Urban Rural - Sydney to Lithgow.

What I noticed

Sydney’s edge is sharp. The city ends at 55 km and the country begins less than 3 km later. There’s no slow fade from suburbs to farmland, and the remoteness class jumps straight from “Metropolitan” to “Small rural towns”, skipping the classes in between. Looking at the map, the line leaves the suburbs at the Hawkesbury and goes almost straight into the Blue Mountains, so geography does most of the work: once the land runs out, so does the city.

A straight line doesn’t follow the road. Most people drive or take the train to Lithgow along the Great Western Highway, through Katoomba and Blackheath. This line runs further north, closer to the Bells Line of Road, through Yarramundi and Blue Mountains - North. So this transect tells the story of a different route over the mountains, and probably a quieter one than the highway towns.

The oldest place isn’t at the end of the line. The median age peaks at 61 in Blue Mountains - North, well above Lithgow’s 46. My guess is that’s the tree-change effect: people retiring to the mountains, within reach of Sydney but out of the suburbs. Lithgow is a working town, and it’s younger.

Income more than halves. The median household in the CBD SA2 earns $2,457 a week; in Lithgow, $1,088. That’s a 55.7% drop over 103 km. It’s the Census in 2021, so the numbers are a few years old, but the gap is unlikely to have closed.

One line, 32 SA2s, and the whole urban-rural story in one map.

Day 9 done. Tomorrow: prompting only, which, for a challenge made entirely in MapAI, might be the easiest theme of the month.

#30DayMapChallenge #mapai #madewithmapai