15

Does anyone know how to perform a overpass-api request like this?

"Show me all banks in Germany"?

I could just show all 'amenity = bank' in a specific bounding-box. But Germany (or most of all countries) doesn't fit very well in such a bbox.

Is there any way to do this? Have you an example? Server performance or runtime is secondary since we could host a own server or something like that :)

2 Answers 2

17

Using Overpass turbo, the syntax is:

area["name"="Nordrhein-Westfalen"]->.boundaryarea;
(
nwr(area.boundaryarea)[amenity=bank];
);
out meta;

nwr is a short for node-way-relation

2
  • It helped me to write ">;" after the closing round bracket ");" and before "out". Otherwise no nodes with coordinates in the map were displayed.
    – qräbnö
    Oct 16, 2018 at 16:10
  • @qräbnö you are right, I updated my answer.
    – AndreJ
    Oct 16, 2018 at 20:00
7

The Quick OSM plugin for QGIS generates the following working Overpass query:

<osm-script output="xml" timeout="200"> 
 <id-query {{nominatimArea:Austria}} into="area"/> 
 <union>
      <query type="node">
           <has-kv k="amenity" v="bank"/> 
           <area-query from="area"/>
      </query>
      <query type="way">
           <has-kv k="amenity" v="bank"/> 
           <area-query from="area"/>
      </query>
      <query type="relation">
           <has-kv k="amenity" v="bank"/> 
           <area-query from="area"/>
      </query>
 </union>
 <union>
      <item />
      <recurse type="down"/>
 </union>
 <print mode="body" />
</osm-script>

for details see Overpass turbo/Extended Overpass Queries

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.