Overpass QL cookbook

Overpass API query examples

99 ready-to-run queries, each explained line by line and run live on our full-planet server. Copy one and change the place or the tags.

Elevation & profiles

Heights of peaks, huts, passes and stations, the vertical rise of lifts, route profiles and sea depths.

Peaks with their height from elevation data

Add a height to every summit with elevation=1 and compare it with the ele tag of OpenStreetMap. Example: the peaks around Zermatt.

Mountain huts and their altitude

Every mountain hut in a region with its altitude, highest first, from elevation=1. Example: the canton of Valais.

Ski lifts and cable cars: vertical rise

The bottom and top height of every lift, from out geom with elevation=1. Example: the lifts of Zermatt, sorted by vertical rise.

Road passes and their height

Find the mountain passes on the main roads of a country and add their height. Example: the road passes of Switzerland, highest first.

The highest train stations

List the railway stations of a country by altitude with elevation=1, and see why stations in tunnels read too high. Example: Switzerland.

Lakes and their surface elevation

The water level of every named lake in a country from elevation=1. Example: Switzerland, from the highest mountain lakes down.

Elevation profile of a mountain railway

Draw the climb of a railway line from its route geometry and the elevation profile API. Example: the Pilatus railway, the steepest rack railway.

Elevation profile of a hiking route

Distance, ascent and descent of a hiking route from OpenStreetMap, with its elevation profile. Example: the Matterhorn Trail in Zermatt.

Offshore wind turbines and the water depth

The sea depth at every turbine of offshore wind farms, from the GEBCO grid via elevation=1. Example: the German Bight.

Guides

All guides →

Run these with your own key

Every example runs unchanged on overpass.ch, on the full planet with minutely updates. The free plan runs all of them except the history examples, which need Pro or Business.

Map data © OpenStreetMap contributors, available under the Open Database Licence.