OSM Overpass API: Complete boundary data
<p>I am trying to figure out if it is possible with the OverpassAPI to download all boundary data for a country.</p>

<p>Small example: Luxembourg
I would like to get all relations that are tagged as (key-value) boundary=administrative. I would like to receive all ways to these relations, and all nodes in these ways.</p>

<p>I assume that could be quite a lot of data (?) so I wonder if one query is the way to go, especially if I would try to do it with Germany or France (with about 20 items on admin_level=4, and hundreds on admin_level=6 or 8)</p>

<p>This is further complicated because the bounding box around the country takes in all other countries sharing a border with the one "in-box".</p>

<p>So this seems not to be the way - what technique would I use to get all nodes on all ways that form administrative boundaries of a country?</p>

<p>What I am currently trying is this</p>

<pre><code>&lt;osm-script&gt;
  &lt;query type="relation"&gt;
    &lt;bbox-query s="49" w="2" n="52" e="7"/&gt;
    &lt;has-kv k="boundary" v="administrative"/&gt;
    &lt;has-kv k="admin_level" v="2"/&gt;
  &lt;/query&gt;
  &lt;print mode="meta"/&gt;
&lt;/osm-script&gt;
</code></pre>

<p>This is a bounding box for Belgium (say mid-size), and restricted to admin_level=2. Also, this does not yet deliver node information.</p>

<p>I know how to change that - but this will deliver all neighbouring countries too. What is a better way of doing this?</p>

<p>Thanks!
Ralf</p>