Marcus Cent's Diary

Recent diary entries

I run cyclists.com, a library of cycling routes. Every route page tries to answer what a rider wants to know before setting off: how much of it is on busy roads, whether it is paved, where the water and cafés are. Nearly all of those answers come from OpenStreetMap, so I wanted to explain how we use the data and pass back a few things we found in it.

What we measure along a route

We don’t use Overpass. A few hundred routes would be unfair load on a public instance, so everything runs against local Geofabrik extracts. For each route line we sample a point every 100 m, take the nearest way within 80 m and read its tags:

  • Road class: highway=* grouped into cycle path, quiet street, minor road, main road (primary/secondary), major road (trunk) and motorway.
  • Cycle provision: highway=cycleway, any cycleway*=* tag that isn’t no, or bicycle_road=yes.
  • “Main roads without a cycle lane”: km on primary, secondary, trunk or motorway ways with none of the above.
  • Fast roads: km where maxspeed is 80 km/h or more (mph converted).
  • Surface: surface=* first; then tracktype; then the road class (a primary road with no surface tag counts as paved, a track as unpaved). Anything else is shown as “no data” rather than guessed.
  • Services: cafés, bakeries, shops, drinking water, toilets, bike shops and railway stations within a few hundred metres of the line, placed by km along the route, plus the longest stretch with none.

Where a sample point is more than 80 m from any way, it counts as unmapped. We say so on the page instead of filling the gap.

A typical result, for a loop in the Hajar mountains above Fujairah: “Most of it (42.6 km) is on main roads without a cycle lane, 16.4 km where the limit is 80 km/h or more. The first 30 km has no café, shop or water.” And for the Deeside Way out of Aberdeen: “62% is on cycle paths or roads with a cycle lane. 52% is mapped as paved and 47% as gravel or unpaved.”

Elevation comes from the Copernicus DEM, not from OSM or from the GPS.

See full entry

I run cyclists.com, a library of cycling routes. Every route page tries to answer what a rider wants to know before setting off: how much of it is on busy roads, whether it is paved, where the water and cafés are. Nearly all of those answers come from OpenStreetMap, so I wanted to explain how we use the data and pass back a few things we found in it.

What we measure along a route

We don’t use Overpass. A few hundred routes would be unfair load on a public instance, so everything runs against local Geofabrik extracts. For each route line we sample a point every 100 m, take the nearest way within 80 m and read its tags:

  • Road class: highway=* grouped into cycle path, quiet street, minor road, main road (primary/secondary), major road (trunk) and motorway.
  • Cycle provision: highway=cycleway, any cycleway*=* tag that isn’t no, or bicycle_road=yes.
  • “Main roads without a cycle lane”: km on primary, secondary, trunk or motorway ways with none of the above.
  • Fast roads: km where maxspeed is 80 km/h or more (mph converted).
  • Surface: surface=* first; then tracktype; then the road class (a primary road with no surface tag counts as paved, a track as unpaved). Anything else is shown as “no data” rather than guessed.
  • Services: cafés, bakeries, shops, drinking water, toilets, bike shops and railway stations within a few hundred metres of the line, placed by km along the route, plus the longest stretch with none.

Where a sample point is more than 80 m from any way, it counts as unmapped. We say so on the page instead of filling the gap.

A typical result, for a loop in the Hajar mountains (Fujairah Loop via Fayyad and Minazif): “Most of it (42.6 km) is on main roads without a cycle lane, 16.4 km where the limit is 80 km/h or more. The first 30 km has no café, shop or water.” And for the Deeside Way out of Aberdeen: “62% is on cycle paths or roads with a cycle lane. 52% is mapped as paved and 47% as gravel or unpaved.”

See full entry