Download data from open street map

 


How to download data from open street map

A complete guide

The quality of your GIS analysis is largely dependent on the quality of the acquired dataset. When mapping data is involved, Open Street Map (OSM) is an invaluable resource. While map providers like Google and Mapbox maintain an equally resourceful database, Open Street Map remains a preferred option for two main reasons: 

Open Street Map is OPEN

The OSM database is FREE and can be accessed by anyone without complications from copyrights. Its access is unlimited for every user and sometimes, data can be downloaded even without creating an account.

OSM’s Access and Coverage 

Interestingly, OSM remains one of the most updated mapping databases consisting of streets, buildings, administrative boundaries, local amenities, etc. It receives data from hundreds of thousands of volunteers over the world, making the OSM database coverage one of the most developed. 

Unlike most pay-to-access mapping services, Open Street Map provides unrestricted access to the raw GIS data behind the map. You too can have access. 

This guide provides detailed steps on the kinds of data you might need from the OSM database and the different methods of extraction.  

1. Downloading Administrative Data From OpenStreetMap 

Obtaining spatial data for a specific administrative area is easy using the GeoFabrik download server. It holds an updated OSM database of different administrative levels – continent, country, state, and multiple sub-regions.

The download server has a list of continents and available file formats. It shows three “quick links” for each format per dataset. They are: .osm.pbf, .osm.bz2 and .shp.zip. Both available .osm file formats are simply compressed osm files while the .shp format is an Esri Shapefile which is yet to be available for all datasets. The Learn osm page discusses this. 

1 Administrative data for sub-regions and available download links. 

Now, let’s try selecting a sub-region here, say the sovereign state of Greater Manchester in England. 

First, select the continent (Numbered as shown in the image below), >1Europe >> 2Great Britain >> 3England > 4Greater Manchester

2  Finding Administrative data for specific state/county on OSM’s GeoFabrick server.

All available quick links to the different formats are displayed as seen. The world map on the right shows the relative location of each region as you hover over its identifier. 

It is worth noting that sub-regions (states and local areas) are not currently available for every country. In such cases, a message saying: “No sub-regions are defined for this region” is displayed. 

2. Downloading Public Amenities Data From OpenStreetMap

Finding amenities and public properties in a specific location can be done using the Quick OSM query. Here, you can find location data for a health care service, ATM gallery, bar, etc. depending on available data. 

As an example, let’s find the relative locations of hospitals and Pharmacies in Greater Manchester. This can be done using either the Overpass API or directly in the QGIS software application in five steps: 

Step 1: Install QuickOSM 

Install and check (using the checkbox) the QuickOSM plugin by searching through the plugins panel on QGIS. 

That is; 1aplugins >> 1bmanage and install plugins >> 2All >> Search >> 3Checkbox > 4Install Plugin. 

3   How to install QuuickOSM plugin on QGIS.

Here’s a more detailed guide on downloading and installing plugins. 

Step 2: Open Quick Query

Access the Quick query tab by lunching the QuickOSM from: 1Vector >> 2QuickOSM > 3QuickOSM

4 Guide to on accessing the QuickOSM plugin

Step 3: Set Query Key, Value, and Location

When open, select 1Quick query >> 2set query key to ‘healthcare’ >> 3set value to ‘hospital’ >> 4Add multiple variables 

>> link them with either the 5‘AND’ or ‘OR’ clauses. While AND selects only locations where both features intersect, OR selects all features which are true for all variables. 

>> 6Set location to point of interest – be sure to enter exact spellings for easier match 

>> 7Advanced settings The advanced settings help you set how features will be represented. For the features we’re working on, ‘Node’ and ‘Points’ are fine. 

>>  8Browse to set layer name (otherwise it saves to a temporary file)

>> 9Run the query and inspect it using the attribute table. 

5   How to set-up QuickOSM and perform analysis on QGIS

Step 4: Categorize features (optional)

On the layers panel, click on 1layer styling >> 2categorized >> set 3value to query key (in this case healthcare )  >> 4classify > Apply

6    How to categorize GIS dataset on QGIS

Export layer to your preferred file format 

Using the Overpass API to Download Data from OpenStreetMap

The above query and results can be achieved using the Overpass API. Openstreetmap provides a great tutorial for this, showing examples, features, and how tags work. Feel free to try it out directly on the web using the Overpass Turbo.

Dealing with a small-sized dataset

In this case, street maps can easily be gotten from openstreetmap.org. Simply enter your location of interest on the search tab. Use the direction buttons, zoom, and pan features to navigate the map on the screen. The size of data available for export is limited to approximately 69 miles (111km). 

That is; 1Search location >> 2navigate >> 3export > 4export  

7    Find and export GIS data from openstreetmap.org

The data is exported as a vector file in .osm format

Dealing with a bigger-sized dataset

For a larger project, the BBBike extract service provides GIS data with a maximum area size of 24,000,000 Square Km and a file size of 512 MB – which is a lot. BBBike Extract offers a lot of flexibility when selecting preferred file formats. From osm to pbf, CSV, SVG, GeoJson, etc. 

8   Find and extract large datasets from BBBike extract

Simply select a 1format >> 2name of area to extract >> 3email address > 4set bounding box (optional). In a few minutes, a download link will be sent to your email address. 

Planet OSM 

The planet.osm is a single file holding a database of all map elements and relations of all available locations. Updates to previous versions are released weekly. At the time of writing, it has a file size of approximately 118 GB when compressed and 1.6TB when uncompressed. 

OSM 3D

This is an exciting project by Open Street Map. It aims at providing an interactive rendering of 3D maps and 3D Spatial Data Infrastructures. What makes the OSM-3D project most exciting is the incorporation of an elevation model, hence, eliminating distortions associated with typical rendering platforms.

Importing Files into QGIS 

Files downloaded from the OSM database are vector files and can be imported into QGIS for analysis. To do this;

Click on Data source manager (Don’t find it? Right-click on your toolbar to confirm it is checked) 

>> Vector >> file >> Browse >> Add > Close

Final Thoughts

Spatial Data is a key factor in the decision-making process and Open Street Map is a great resource. It is protected under the Open Data Commons Open Database License. You can contribute to the OSM services by volunteering or making donations. Leave a comment in the section below if this worked well for you or if you encountered any difficulties.