1

I am using QuickOSM to download the boundaries of cities into QGIS before saving each city data as a GeoJSON. QuickOSM enables the Key (in my case, 'boundary') and Value ('administrative) to be specified, but I don't know how to specify the administrative level (admin_level=x). However, I need to do this to get the boundaries for the actual city. At present, I get boundaries for the wrong administrative level. For instance, running the query for 'Amsterdam' outputs the boundaries for the Netherlands as a whole. What can I include in the Overpass Query to specify the administrative level? Shown here this

0

Instead of having just:

<has-kv k="boundary" v="administrative"/>

You should add a line:

<has-kv k="boundary" v="administrative"/>
<has-kv k="admin_level" v="8"/>

I also removed sections for node and way:

<osm-script output="xml" timeout="25">
    <id-query {{geocodeArea:amsterdam}} into="area_0"/>
    <union>
        <query type="relation">
            <has-kv k="boundary" v="administrative"/>
            <has-kv k="admin_level" v="8"/>
            <area-query from="area_0"/>
        </query>
    </union>
    <union>
        <item/>
        <recurse type="down"/>
    </union>
    <print mode="body"/>
</osm-script>
1
  • Thanks for that, just getting strated with Overpass syntax. – Ben Mann Feb 20 '20 at 23:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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