Overpass query example

Building outlines

Get every building footprint in a small area. Example: the old town of Bern.

Buildings are ways (or multipolygons) tagged building=…. Footprints are dense: keep the area small, or the answer becomes very large.

The query

[out:json][timeout:25];
way["building"](46.945,7.440,46.952,7.458);
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. ["building"] without a value matches every building type (house, apartments, church, …).
  2. out geom; returns each outline with coordinates.

Variations

  • Add rel["building"] in a union to include buildings with courtyards.
  • For the buildings of a whole city, use a regional extract (for example Geofabrik) instead of Overpass.

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 →