Overpass query example

Castles in a region

Find castles, palaces and fortresses. Example: Rhineland-Palatinate.

Castles are tagged historic=castle; castle_type says whether it is a fortress, a palace, a manor or a ruin (ruins=yes).

The query

[out:json][timeout:60];
area["name"="Rheinland-Pfalz"]["admin_level"="4"]->.a;
nwr["historic"="castle"](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. German federal states have admin_level 4. Use their German name.

Variations

  • Only ruins: add ["ruins"="yes"]. Palaces: ["castle_type"="palace"].

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 →