All thirty days

Day 25: Is this a map?

Canada drawn with nothing but its people: 83 lines of latitude, each raised by the 2021 census population along it. Toronto and Montréal are twin summits, and 79.4% of the range is flat.

ridges.json
Loading 83 lines of people
Show
Click a line.

There is no coastline on this map, no border and no place name. Each line runs east to west along a half degree of latitude, 83 of them from the north shore of Lake Erie to Ellesmere Island, drawn only where it crosses Canadian land, and rises with the people who lived along it in the 2021 census. A line further south hides the ones it rises in front of, the way a near ridge hides a far one. The country's shape is what is left: the lines stop at every shore, so Hudson Bay, the Gulf of St. Lawrence and the Arctic channels are gaps.

The summits are the cities. Toronto and Montréal are twins, 660 and 620 people per km² at their peaks, then comes a range of hills: Calgary 215, Edmonton 206, Vancouver 198, Ottawa-Gatineau 194. Everything else is foothills or flat: on 79.4% of the 180,627 km of line, fewer than 1 person lives in every 2 km².

Read it from south to north and the people run out fast. Half of Canadians live south of 45.6°N, about the latitude of Laval, just north of Montréal. 68.4% live south of 49°N, the parallel the western border follows, and 0.33% north of 60°N. Switch on the map underneath to see where each peak stands, and click a line for the people who live along it.

How it's made

One basemap and one layer. This is the whole map, minus the legend.

import { createMap } from '@unmap/sdk'

// One line every 0.5° of latitude, sampled every 0.1° of longitude over land. Each sample is the
// 2021 census population density there: every area's people shared between the two lines either
// side of it, then spread along the line over a 40 km Gaussian.
const rows = await fetch('/30daymapchallenge/2026/ridges.json').then((r) => r.json())

// Raise each line by its density, then walk south to north: a line hides what it rises in
// front of, so keep the highest point drawn so far at each sample and cut the lines behind it.
const lines = ridgeLines(rows, { peak: 12 })                     // Toronto, 12° above its line

const map = createMap({ key: 'um_pk_live_...', container: '#map', style: 'muted' })
map.on('load', () => {
  for (const layer of map.getStyle().layers)                     // no basemap: only the lines
    if (layer.type !== 'background') map.setLayoutProperty(layer.id, 'visibility', 'none')
  map.addSource('ridges', { type: 'geojson', data: lines })
  map.addLayer({ id: 'ridges', type: 'line', source: 'ridges', paint: { 'line-color': '#DCE6E4' } })
})

The populations are the 2021 census counts of Canada's 57,936 dissemination areas, from Statistics Canada's Geographic Attribute File, each placed at the area's representative point. A script shares each area's people between the two lines on either side of it, in proportion to how near each is, so every person lifts the lines by exactly one person, then spreads them along the line over a Gaussian 40 km wide and across the 56 km between two lines. That gives a density, in people per km², every 0.1° of longitude along each line where the line is over land: inside a census subdivision, with one sample of slack at the shore. The page raises each line in proportion, the tallest peak 12° of latitude above its own line, and walks the lines from south to north, cutting each one where a line in front of it has already risen higher. A height is a density averaged over a wide strip, not the density of a city, which is why Toronto peaks at 660 people per km². A city between two lines, like Vancouver, is shared between them and stands lower than one centred on a line, like Montréal. The reserves and settlements the 2021 census could not enumerate have no count, so they add nothing. A line's popup counts the people within 28 km of it, from the areas' points, without smoothing. The script is scripts/build-challenge-ridges.mjs in the unmap repository.

Data

  • Population: Statistics Canada, 2021 Census, Geographic Attribute File (92-151-X), Statistics Canada Open Licence.
  • Land: Statistics Canada, 2021 Census, census subdivision boundary file, Statistics Canada Open Licence.
  • Basemap, under the lines: unmap, © OpenStreetMap contributors.

Share this map

Post it, or make your own and tag it #30DayMapChallenge.