Overpass query example

Mountain huts and their altitude

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

Not every hut has an ele tag. With elevation=1 every result gets the height of the terrain at its position, so every hut has an altitude.

This query lists the staffed mountain huts in the canton of Valais.

The query

[out:json][timeout:60];
area["ISO3166-2"="CH-VS"]->.valais;
nwr["tourism"="alpine_hut"](area.valais);
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™-30 © 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. Switzerland and Liechtenstein: © swisstopo. Sea depths: GEBCO Compilation Group (2026) GEBCO 2026 Grid.

The query step by step

  1. area["ISO3166-2"="CH-VS"] is the canton of Valais, by its ISO 3166-2 code. Unlike the name, the code is unambiguous.
  2. out center; gives one point per hut, also for huts mapped as a building. With elevation=1, the center gets the elevation field.
  3. In Valais the heights come from the 2 m grid of swisstopo; they agree with ele to within about 2 m in the median.
  4. The highest is the Capanna Regina Margherita, on the summit of the Signalkuppe at 4,554 m; the model reads 4,555 m there.

Variations

  • Nodes carry the height directly, ways and relations in their centre: h = el.get("elevation") or el["center"]["elevation"].
  • Unstaffed shelters too: nwr["tourism"~"^(alpine_hut|wilderness_hut)$"], as in mountain huts.

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 →