Overpass query example

Parks in a city

Get park outlines with their names. Example: Manhattan.

Parks are areas tagged leisure=park. Large parks such as Central Park are multipolygons, so search ways and relations.

The query

[out:json][timeout:60];
area["name"="Manhattan"]["admin_level"="7"]->.a;
wr["leisure"="park"](area.a);
out geom;

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 boroughs of New York, like Manhattan, have admin_level 7.
  2. out geom; returns the outlines, drawn as areas on the map below.

Variations

  • Gardens and green spaces: add wr["leisure"="garden"] and wr["landuse"="grass"].

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 →