Gold in Dartmoor A research project

Mapping Dartmoor without Ordnance Survey

Every good map of Dartmoor is an OS map, and OS mapping cannot be republished. Here is how the maps on this site were built from open data instead, and what was lost along the way.


A research site about where to go needs maps. In Britain that is immediately awkward, because the maps everybody actually uses (the Explorer OL28 sheet in every Dartmoor walker’s rucksack) are Ordnance Survey products, and OS mapping is licensed. You cannot screenshot it onto a public website, and tracing it does not help either, because a derived work is still a derived work.

So this project uses none of it. Here is what it uses instead.

OpenStreetMap and the Overpass API

OpenStreetMap is a crowd-sourced geographic database licensed under the Open Database Licence, which permits reuse including commercially, provided you attribute it and share alike any adapted database. That is a licence a project like this can comply with easily.

The useful part is that you can query the underlying database rather than just view tiles. The Overpass API takes a query in its own small language and returns matching features as JSON. Three queries covered everything needed here:

rel["boundary"~"national_park|protected_area"]["name"~"Dartmoor",i];

returns the National Park boundary as a relation of way segments.

way["landuse"="military"](50.45,-4.35,50.80,-3.65);
way["military"="danger_area"](50.45,-4.35,50.80,-3.65);

returns military land in a bounding box around the northern moor. This one produced the find of the exercise: named polygons for Okehampton Range, Merrivale Range and Willsworthy Range, alongside a scatter of smaller features: rifle ranges, an assault course, gun emplacements, and a latrine block, which OSM records with admirable thoroughness.

way["waterway"="river"](50.35,-4.40,50.90,-3.45);

returns 929 river segments across Devon, from which the ones that matter to the gold story were filtered by name.

Trimming it down

Raw Overpass output is far too heavy to ship to a browser. The rivers alone came back at 1.4 MB. Two steps fixed that.

Filtering by name. Only watercourses that drain Dartmoor or feature in the gold literature were kept: the Erme, Avon, Yealm, Plym, Meavy, Tavy, Walkham, Dart and its forks, Teign, Bovey, Taw, Torridge, Creedy, Exe and a handful of others. That took 929 features down to 550.

Douglas–Peucker simplification. The classic line-simplification algorithm: find the point furthest from the straight line between the endpoints, and if it is closer than your tolerance, throw away everything in between. Recursive, about twenty lines of Python, and at a tolerance of roughly 50 metres it removes most of the vertices while leaving the shape of a river entirely recognisable at the zoom levels this site uses.

Combined with rounding coordinates to five decimal places (about a metre of precision, which is far more than a schematic map needs) the rivers file came down from 1,434 KB to 110 KB. The boundary went to 11 KB and the three ranges to 1 KB.

Coordinates for places

Place positions come from OSM’s Nominatim geocoder, which is the same data under the same licence. A short script with a disk cache and a one-second delay between requests, in line with their usage policy, resolved the research place names: Holbeton, Loddiswell, Deckport, Smallbrook, Sheepstor and the rest.

It is worth being honest about the limits. Nominatim confidently placed “Hope Cove, Devon” at Hope’s Nose in Torquay, forty miles from the actual Hope Cove, a reminder that geocoders match strings, not intentions, and that anything going on a map deserves a sanity check against what you already know of the area.

What was lost

Being straightforward about the trade-off, because it matters if anyone tries to use these maps in the field:

  • No contours, no relief. OS’s greatest asset for moorland navigation is the one thing open data does not replicate well at this scale. These maps show you where things are, not what the ground does.
  • No field boundaries or access detail. Nothing here tells you where a footpath runs or where a wall is.
  • Generalised range boundaries. The military polygons are OSM landuse data, simplified further. They will tell you that somewhere is in range country. They will not reliably tell you that you are outside one. On the ground, the red-and-white boundary posts and the official firing notices are the authority, and nothing on a website should ever displace them.

For orientation and for showing the relationship between the geology, the boundary and the ranges, open data is entirely sufficient. For walking on, buy the OS sheet, which is, after all, exactly what its licence is protecting.

The scripts

All three live in research/geodata/ in the repository: fetch_osm.py to query Overpass, process.py to filter and simplify, geocode.py for place names. The processed GeoJSON is served straight from /data/ and can be inspected from the map page.