Overpass query example

Tall buildings by number of floors

Find buildings with 15 or more floors using a numeric if: filter. Example: Frankfurt.

building:levels is the number of floors above ground. number() converts it, so it can be compared.

The query

[out:json][timeout:60];
area["name"="Frankfurt am Main"]["admin_level"="6"]->.a;
wr["building"](if: number(t["building:levels"]) >= 15)(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. number(t["building:levels"]) reads the tag as a number; missing values do not pass.
  2. Frankfurt is a district-free city (admin_level 6).

Variations

  • Height in metres, where mapped: (if: number(t["height"]) > 100).

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 →