querying and extracting vector layers from openstreet map using overpass turbo api

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.

6

2. Click on the red boxed option on the Wiki page to access the application proper.

7

3. The API page opens.

8

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.

9

5. Click on the Wizard option on the menu bar.

11

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.

12

7. Features that qualify as landuse = residential are selected as shown on the screen shot below.

13

8. Next, we export the selected layers out in geojson format. Click Export button on the menu bar.

15

9. This Export window will open. click on the as geoJSON option red boxed on the screenshot below. Click done to export.

16

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.

17

11.  The Query selects highways within the map view that are tagged residential.

18

12.  We export this layer too in geojson format.

19

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.

20

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.

21

15. Right Click on the layers to inspect their attribute tables. We choose the polygon layer.

22

16. On the screenshot below, a selected feature on the attribute table of the layer is highlighted in yellow.

23

 

Thank you for following the blog.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s