Overpass QL cookbook

Overpass API query examples

93 ready-to-run queries, each explained line by line. They run live on our full-planet server, so you see the real result. Copy one, change the place or the tags, and you're done.

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

Help with errors and limits, setting up tools and libraries, and elevation data. All guides →

Run these with your own key

Every example works unchanged on overpass.ch: full planet, updated every minute, no shared rate limits. The free plan is enough to try them all.

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