Overpass query example

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.

On a lake, the elevation model returns the water surface, not the bottom. With out center; and elevation=1, every lake gets its surface elevation.

This query lists the named lakes of Switzerland, from the highest mountain lakes down to the lakes of Ticino.

The query

[out:json][timeout:90];
area["ISO3166-1"="CH"][admin_level=2]->.ch;
nwr["natural"="water"]["water"="lake"]["name"](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. ["natural"="water"]["water"="lake"]["name"] finds named lakes. Big lakes are multipolygon relations.
  2. out center; gives the centre of the bounding box around each lake, and elevation=1 the height there.
  3. For the lakes with an ele tag, the median difference is below 1 m.
  4. The centre of a long, curved lake can fall on the shore: for Lago Maggiore it reads 256 m instead of 193 m. For those, look up a point you know is on the water.

Variations

  • Reservoirs: ["water"="reservoir"]; their dams are way["waterway"="dam"].
  • The outlines: out geom;, as in named lakes of a country. With elevation=1 every outline point then gets a height, which uses many more lookups.

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 →