Overpass query example

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.

With elevation=1 every station gets the height of the terrain at its position. Sorted, that gives the highest stations of a country.

The elevation model describes the ground surface, so a station in a tunnel gets the height of the mountain above it. Eigerwand, a station inside the north face of the Eiger at 2,866 m, reads about 3,170 m.

The query

[out:json][timeout:90];
area["ISO3166-1"="CH"][admin_level=2]->.ch;
nwr["railway"="station"](area.ch);
out center;

Run it

Running the query…

Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL). Heights produced using Copernicus WorldDEM™-90 © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved. Sea depths: GEBCO Compilation Group (2026) GEBCO 2026 Grid.

How it works

  1. nwr["railway"="station"] finds stations of every railway, including rack railways and funiculars tagged as stations.
  2. out center; gives one point per station, and elevation=1 an elevation for each.
  3. For the more than 1,100 stations with an ele tag, the median difference is below 1 m.
  4. Underground stations are the exception. Jungfraujoch, at 3,454 m the highest railway station in Europe, lies inside the rock and reads about 30 m high.

Variations

  • To leave out tunnel stations, skip those with location=underground or a negative layer, or prefer ele where it exists.
  • Halts too: nwr["railway"~"^(station|halt)$"]. Without heights: train stations in a country.

Run it from your code

The query is unchanged; elevation=1 in the URL adds the heights. Each height uses one lookup from your elevation allowance.

curl 'https://api.overpass.ch/v1/YOUR_API_KEY/interpreter?elevation=1' \
  --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 →