All thirty days

Day 14: Borgesian map

The Dominion Land Survey, a grid of 22,284 townships laid over the prairies from 1871, and the roads that grew onto it: 69.3% of the 543,571 km of public road inside it runs on a section line.

survey.json
Loading 22,284 townships
Look at
Share of a township's road on a section line
No public road
Zoom in for the sections. Click a township.

In Borges' one-paragraph story On Exactitude in Science, an empire's cartographers make a map the size of the empire, matching it point for point. Canada made one. From 1871 the Dominion Land Survey laid a grid over the prairies, mostly ahead of the farmers who would settle them: townships six miles square, each cut into 36 sections of a square mile, with road allowances 66 feet wide along the section lines. It covers 22,284 townships, about two million square kilometres: all of Alberta, Saskatchewan and Manitoba, and the Peace River country of British Columbia.

Then the territory grew onto the map. Of the 543,571 km of public road that OpenStreetMap maps inside the grid, 376,771 km, 69.3%, runs within 30 m of a section line, on the allowances the surveyors set aside. A road laid across the grid at random would come that close about one time in ten. Saskatchewan's roads are 79.9% on the lines, Manitoba's 71.7% and Alberta's 59.7%. In Alberta the roads are even named after the map: 114,986 km is called Range Road or Township Road, and 89.9% of it is on a section line.

The map corrects itself in plain sight. Meridians draw together toward the pole, so every four townships north the grid starts again from a correction line, and its north-south lines step sideways there, by 962 m at the median. The roads step with them. One of the survey's lines became a border: the 4th meridian, at 110° W, is the line between Alberta and Saskatchewan.

Where the land was already divided, the grid stopped. In October 1869 Louis Riel and a group of Métis stopped a Canadian survey crew on André Nault's hay land at Red River, at the start of the Red River Resistance. The river lots, long strips running back from the Red and the Assiniboine, were kept, and the grid has no sections there. In the two townships at the heart of Winnipeg, 1.8 km of the 1,961 km of road is on a section line.

Borges' map ends in tatters in the western deserts. This one runs on to 60° N, across the boreal forest and the Canadian Shield, where 11,272 of its 22,284 townships hold no public road at all. Zoom in, or pick a view under the map, and the section lines appear under the roads: a line left in magenta is an allowance no road took. Click a township for its legal description and its road.

How it's made

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

import { createMap } from '@unmap/sdk'
import { along, length, pointToLineDistance, polygonToLine } from '@turf/turf'

// The Dominion Land Survey is an unmap layer: one archive, a source-layer per province and level.
const survey = 'https://api.unmap.dev/layers/survey.dls/{z}/{x}/{y}?key=um_pk_live_...'

const map = createMap({ key: 'um_pk_live_...', container: '#map', style: 'muted', mode: 'dark' })
map.on('load', () => {
  map.addSource('survey', { type: 'vector', tiles: [survey], minzoom: 10, maxzoom: 14 })
  const labels = map.getStyle().layers.find((l) => l.type === 'symbol').id
  for (const p of ['ab', 'sk', 'mb', 'bc']) {
    map.addLayer({ id: p + '-sections', type: 'line', source: 'survey', 'source-layer': p + '_sec',
      paint: { 'line-color': '#FF3E9A', 'line-width': 1 } }, labels) // over the roads, under the names
  }
})

// Is a road on the survey? Walk it in 25 m pieces and measure each against the section edges.
// The road allowance is 20 m wide, so a road down its middle is 10 m from each section.
function kmOnTheLines(road, sections) {
  const edges = sections.map((s) => polygonToLine(s))
  const metres = length(road, { units: 'meters' })
  let on = 0
  for (let d = 12.5; d < metres; d += 25) {
    const piece = along(road, d, { units: 'meters' })
    if (edges.some((e) => pointToLineDistance(piece, e, { units: 'meters' }) <= 30)) on += 25
  }
  return on / 1000
}

The grid is unmap's Dominion Land Survey layer, survey.dls, which joins the four provinces' own open survey grids. The roads are every OpenStreetMap way tagged motorway, trunk, primary, secondary, tertiary, unclassified or residential in the Canada extract unmap's routing graph is built from, dated 17 September 2026; tracks, service roads and ramps are left out. A script cuts each road into pieces of at most 25 m and measures every piece against the edges of the sections in the layer's zoom-12 tiles, which hold the lines to within about 2 m. A piece within 30 m of a section edge is on a section line: the allowance is 20 m wide, and the rest allows for how closely a road is traced. At 15 m the share is 66.6% and at 50 m 71.1%, so the finding does not hang on the threshold. A piece belongs to the township it is in, or the nearest one within 100 m, since an allowance between two townships is in neither; road outside the grid is not counted. OpenStreetMap is mapped by volunteers and is more complete in some places than others, and a road it does not show is not counted either. The townships are drawn from the layer's zoom-8 tiles, accurate to about 25 m, and the section lines that appear as you zoom in are the layer itself. The layer comes with the Legal Land add-on, which Energy and Agriculture also include; a key with none of the three gets a 403 for its tiles. The script is scripts/build-challenge-survey.mjs in the unmap repository.

Data

  • Survey grid: unmap's Dominion Land Survey layer, from the Alberta Township System v4.1 (Open Government Licence - Alberta), Saskatchewan GeoHub (GOS Standard Unrestricted Use Data Licence v2.0), the Manitoba Land Initiative (OpenMB Information and Data Use Licence) and the BC Data Catalogue (Open Government Licence - British Columbia).
  • Roads: © OpenStreetMap contributors (ODbL), Canada extract of 17 September 2026.
  • Basemap: unmap, © OpenStreetMap contributors.

Share this map

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