Overpass query example

Schools in a city

Find all schools in a city, with their grounds. Example: Amsterdam.

Schools are tagged amenity=school, usually on the school grounds. Kindergartens, colleges and universities have their own tags.

The query

[out:json][timeout:60];
area["name"="Amsterdam"]["admin_level"="8"]->.a;
nwr["amenity"="school"](area.a);
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. Dutch municipalities have admin_level 8.
  2. out center; returns the centre of each school site.

Variations

  • All education at once: nwr["amenity"~"^(kindergarten|school|college|university)$"].

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 →