Overpass query example

Hiking routes in a region

Get marked hiking trails as route relations with their geometry. Example: around Zermatt.

Signposted hiking trails are relations of type route=hiking. Their members are the paths they follow. Here they are searched in a bounding box around Zermatt.

The query

[out:json][timeout:60];
rel["route"="hiking"](45.95,7.65,46.07,7.85);
out geom;

Run it

Running the query…

Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).

How it works

  1. Routes are found when at least one member is inside the box, so long-distance trails come out whole.
  2. The network tag says the level: iwn international, nwn national, rwn regional, lwn local.

Variations

  • Only national trails: add ["network"="nwn"].
  • Mountain hiking difficulty is on the paths: way["sac_scale"].
  • Distance, ascent and descent of one route: elevation profile of a hiking route.

Run it from your code

curl https://api.overpass.ch/v1/YOUR_API_KEY/interpreter \
  --data-urlencode 'data@query.overpassql'

Save the query as query.overpassql. It works the same in Overpass Turbo, QGIS and JOSM.

More examples

All examples →