Deriving Vector Layers of Administrative Boundaries from OpenStreetMap

  1. Administrative boundary
  2. Political Boundary
  3. Local Government Boundary

Overpass turbo API

Source: https://wiki.openstreetmap.org/wiki/India/Administrative_Boundaries
  • There is a chance of getting time out error since all India level data might take more time to query, hence increase the timeout in the code window on the left or copy-paste the code block below and run.
/*The original search was:“admin_level=5 and boundary="administrative"”*/[out:json][timeout:1000];// gather results(// query part for: “admin_level=5 and boundary=administrative”node["admin_level"="5"]["boundary"="administrative"]({{bbox}});way["admin_level"="5"]["boundary"="administrative"]({{bbox}});relation["admin_level"="5"]["boundary"="administrative"]({{bbox}}););// print resultsout body;>;out skel qt;
  • If you need to extract only a specific district only write a combined query with the district name or wikidata QID. Note while giving the name it should be the same name which is under the name tag given in OpenStreetMap. For example for Pune District, it is given as “Pune District”, while for Hyderabad it is just “Hyderabad”. There might be reasons for this nomenclature. The easy method knows this is the first query without a name and will check the value of the name tag of the required district then add the tag to query and rerun it.
admin_level=5 and (boundary="administrative" and name="Pune District")
  • The results will be displayed in the map window at the right.
  • Click on Export and choose the required format. For ESRI shapefiles download in geojson and convert using QGIS

QGIS

  • Install the QuickOSM plugin from the plugin menu
  • Open the QuickOSM plugin either by clicking the icon on the top or the from vector menu (Vector > QuickOSM > QuickOSM)
  • Give the required key and value and the area in the respective boxes. Also, increase the timeout and check the required layers in the Advanced option at the bottom. Click on the Run query button.
  • The result of the above query has given an out of polygon layer with all municipalities of Kerala.
  • You may need to clean the attribute table a bit as it may contain a lot of columns which may not be required. Also, manually delete if there are any additional polygons in the resultant layer. You can either use the selection by query tool or manually delete it from the attribute table.

--

--

Geospatial Engineer | #Opendata | #OpenStreetMap | Blogs @ arkives.in

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store