All thirty days

Day 2: Lines

The fastest drive from Calgary to 3,033 cities, towns, villages and hamlets across Canada, drawn as one tree from unmap's own routing.

roads.json
Loading 3,033 routes
Drive time from Calgary
Click a road or an open circle.

Every line here is part of a real route. We asked unmap's routing API for the fastest drive from Calgary to each city, town, village and hamlet from Day 1, 3,085 requests in all. Where routes share a road, the road gets wider, so the network sorts itself into a few trunks and thousands of thin branches.

Five routes in six leave Calgary heading east: 2,550 of them. Quebec alone holds 1,147 of the destinations, more than any other province, and Saskatchewan's 685 villages and towns turn the prairies into a fan of branches.

Colour is drive time. Edmonton is under three hours away, Vancouver 10, Toronto 35 and Montréal 39. The far end is Nain, on the Labrador coast: 97 hours and 6,107 km, the last stretch on the coastal ferry, because no road reaches it.

49 places have no road from Calgary at all, drawn as open circles: 25 in Nunavut, 17 in northern Quebec, and Churchill, Manitoba, which you reach by train.

How it's made

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

import { Unmap } from '@unmap/sdk'

const unmap = new Unmap({ key: 'um_live_...' })
const calgary = [-114.0577, 51.0453]

// One fastest drive per town. Count how many routes use each stretch of road.
const uses = new Map()
for (const town of towns) {
  const route = await unmap.router.route(calgary, town, { mode: 'car' })
  const coords = route.geometry.coordinates
  for (let i = 1; i < coords.length; i++) {
    const segment = coords[i - 1] + '>' + coords[i]
    uses.set(segment, (uses.get(segment) ?? 0) + 1)
  }
}

// Draw every segment with a width that grows with its count.
map.addLayer({
  id: 'roads',
  type: 'line',
  source: 'roads',
  paint: { 'line-width': ['interpolate', ['linear'], ['ln', ['get', 'count']], 0, 0.4, 8, 7] },
})

We sent 3,085 route requests to unmap's routing API (mode=car), two at a time, and saved the answers. A script splits every route into short stretches of road, counts how many routes drive each one, and joins stretches with the same count into lines. The API returns one duration per route, so the drive time along a route is estimated in proportion to distance. The routing graph covers Canada only, so no route can cut through the United States, and three border towns the graph cannot reach from the Canadian side (Stanstead, Lac-Frontière and Haut-Madawaska) are left off. The page and the scripts were written with an AI coding assistant (Claude).

Data

  • Routes: unmap routing on OpenStreetMap data, © OpenStreetMap contributors (ODbL).
  • Places: Canadian Geographical Names Database, Natural Resources Canada. Contains information licensed under the Open Government Licence - Canada.
  • Basemap: unmap, © OpenStreetMap contributors.

Share this map

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