Downloading Vector Data From OSM
Table of contents:
License: This article is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
For any geospatial analysis data is most important. Like said “Garbage in Garbage out” without relevant and reliable data the results are also unreliable. The lion share of the cost and time of a geospatial project is consumed by the data collection and conversion of data to a GIS friendly format. Also a lot of time and manpower is invested in the processes like digitisation of maps in order to use it for geospatial analysis. On the other hand the same data is available in many open data sources. Thanks to the efforts put in by the volunteers for the data creation. One among the most required data of this kind is the road network. Openstreetmap is a free collaborative editable map project for open map data. The data from OSM can be downloaded in GIS friendly format using various tools like Overpass turbo, HOT OSM Export etc. This article explains how to extract specific and structured data available on OSM using Overpass Turbo. Overpass turbo is a web based data mining tool for OpenStreetMap.
There are a lot of structured data pages available in openstreetmap wiki which are a search away. A few are listed below
Downloading National Highways of India
- Open the OSM wiki page
- Go to the required NH number in the Table
- Verify the route and number
- The wikipedia article is linked to verify the old/new number
- Click on the number in the relation column
- The details and route are mentioned in the new page
- OSM follows a key:value pair tag system for saving the data. This tag and corresponding value are used to query the required data.
- Since the road is linked with the wikidata, it is always easy to use the wikidata tag for queries to make it simple.
- Open the overpass turbo API (A detailed documentation of Overpass turbo query and tutorials are available here)
- Zoom in (approximately) to the location and such that the part of stretch will be bounded inside the area in the map at the right.
- Click on Wizard button
- Add the corresponding tag’s key and value (say wikidata=Q643149). However if the unique tag (here wikidata) is not available we should write a complex query with more than 2 tags. (Please refer the documentation for tutorial)
- Click on the build and run query button.
- After execution the area will be highlighted. However for bigger areas HOT OSM export is advised.
- Click on the Export button in the top menu bar
- Select the required format from the dialogue box.
- Overpass turbo gives different download options and formats. We can download data, map, and even query. Hurray ! We have downloaded the geo data from OSM, thanks to all the OSM Volunteers for their valuable time!
Downloading National Parks of India
- Open the OSM wiki page
- The pre build overpass turbo query is given for all india level.
- If you need a specific National park, go to the required National park in the Table.
- Verify the area and the wikipedia article is also linked for better understanding.
- Click on the number in the relation column.
- Here let us take a National Park without wikidata linkage.
- Open overpass turbo and zoom in to the approximate area and click on the Wizard query build button.
We need to use complex query for extraction of this national park like
boundary:national_park and name:"Rajiv Gandhi NP"
Note: The authenticity of OSM data is still a question. OSM volunteers try their maximum to map things to the greatest accuracy and precision. However there are chances for error, so it is advised to verify the data accuracy before usage. Also don’t forget to give data attribution to the OSM Volunteers as a token of appreciation to them. Last but least join the OSM community and start using and editing the Openstreetmap and make it rich with quality data.
Happy mapping!
Any Comments on the article? Let me know @arkarjun.