Overpass query example

Hospitals in a country

List every hospital in a country, mapped as points, buildings or campuses. Example: Ireland.

Hospitals are mostly mapped as areas covering the site, sometimes as multipolygon relations. nwr with out center turns them all into one point each.

The query

[out:json][timeout:60];
area["ISO3166-1"="IE"][admin_level=2]->.ie;
nwr["amenity"="hospital"](area.ie);
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. Hospitals are rarely single nodes; most results are ways and relations.
  2. Use out geom; instead of out center; to get the site outlines.

Variations

  • Emergency departments: add ["emergency"="yes"].
  • Clinics and doctors are amenity=clinic and amenity=doctors.

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 →