Overpass query example

Beaches

Find every beach on an island. Example: Mallorca.

Beaches are areas tagged natural=beach, with the material in surface (sand, gravel, pebbles).

The query

[out:json][timeout:25];
nwr["natural"="beach"](39.25,2.30,39.97,3.48);
out center;

Run it

Running the query…

Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).

How it works

  1. The bounding box covers the island of Mallorca.
  2. out center; gives a point for each beach area; use out geom; for the outlines.

Variations

  • Sandy beaches only: add ["surface"="sand"].

Run it from your code

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