OpenStreetmap.org is without argument, one of the largest free online GIS data resources available. OpenStreetMap can boast of GIS data in the form of vector layers comprising POIs, road layers, buildings amongst others. OSM data covers most parts of the entire world at varying scales. Overpass Turbo API is a web based data mining tool for OpenStreetmaps.
This post will demonstrate how to use the Overpass Turbo API to query and export vector layers from OpenStreetmap to other GIS applications. In this demonstration, we intend to extract landuse and linear features from Abuja Nigeria, West Africa.
1. Enter ‘overpass turbo’ into your preferred search engine.
2. Click on the red boxed option on the Wiki page to access the application proper.
3. The API page opens.
4. Go to the map area (A. Enter the address of the location where you want your vector layers from (B. Select from the list of options narrowing down to the area we need.
5. Click on the Wizard option on the menu bar.
6. In the Query Wizard window, we will put in a query to extract the landuse layers in the map view that are tagged – residential. ‘Click on build and run query’ to extract the layers.
7. Features that qualify as landuse = residential are selected as shown on the screen shot below.
8. Next, we export the selected layers out in geojson format. Click Export button on the menu bar.
9. This Export window will open. click on the as geoJSON option red boxed on the screenshot below. Click done to export.
10. Next we extract line features called highways which have the tag-residential. OpenStreetmaps use the term ‘highway’ to store some categories of roads and streets.Open the Query Wizard as before and inout highway=residential. This time again click on ’build and run query.
11. The Query selects highways within the map view that are tagged residential.
12. We export this layer too in geojson format.
13. Now we have the features we need exported as vector files, we will use our QGIS Desktop application to visualize the OSM layers. Launch QGIS Desktop and click on the Add Vector Layer button.
14. Navigate to where the exported files were stored and add them to the map window in QGIS. As you can see on the screenshot below, the linestring rep the highway features from OSM while the polygon represent the landuse features.
15. Right Click on the layers to inspect their attribute tables. We choose the polygon layer.
16. On the screenshot below, a selected feature on the attribute table of the layer is highlighted in yellow.
Thank you for following the blog.