OpenStreetMap Data Structure

The OpenStreetMap (OSM) project is one of the most impressive projects of Volunteered Geographic Information. The OSM project stands out from other data sources mainly because it’s free to use and released under a license that allows for pretty much whatever the user wants to as long as the user mention the original creator and the license. The most common contribution approach is to record data using a GPS receiver and edit the data using one of the free and available OSM editors. Crowdsourced geographic data has characteristics or advantages of large data volume, high currency, a large quantity of information and low cost.

Data structure

OpenStreetMap uses a topological data structure. This structure includes three basic components nodes, ways, and relations. Nodes are points with a geographic position stored as coordinates (Lat, long) according to WGS84. Ways are lists of two or more nodes, representing an open- or closed way used to describe streets, rivers, among others. A relation is an ordered list of one or more nodes, ways, and/or relations and is used to define logical or geographical relationships between the other elements. This data structure is unique and only supported by OSM.

Skjermbilde 2017-10-07 kl. 12.44.38
A node component, also called POI (point of interest)

Skjermbilde 2017-10-07 kl. 13.52.47
A way component representing a highway (nd-tag refers to node components)

Skjermbilde 2017-10-07 kl. 14.02.00
A relation component representing a building (member-tag refers to both node- and way components)


OpenStreetMap’s structure uses tags to add metadata to geographic objects. Tags consist of two items, a key and a value of the form key=value. The key is used to describe the topic, category or type of feature, while the value represents the details of the particular form of the key specified. An example of a key-value pair can be building=church, here the key is building and the value is a church, this is a building that was built as a church. OpenStreetMap does not have any restrictions on tags assigned to nodes, ways or relations, and mappers can use any key-value pair in their import. Nevertheless, the norm in OSM is to try to map new data with existing tags.


The .osm file format is specific to OpenStreetMap, and it is not easy to open these files using GIS-software like QGIS. The file format is designed to be easily sent and received across the Internet in a standard format. Therefore .osm files are easily obtained, but using the files directly for analyzing and map design is not easy. The .osm files are coded in the XML format. It is recommended to convert the data into other formats when using the files.

Extract OSM data

The Overpass Turbo web page is used to extract OSM data. Here one can run queries to extract specific map features from OSM. On the taginfo web page you can find all key-value pairs used in OSM and also how common they are. When creating a query you can use both values and keys to find the specific elements you are looking for.

 Skjermbilde 2017-10-29 kl. 17.58.10

To create a query I would recommend the Wizard button. This creates the query for you. In the Wizard input field one can write key=value pairs, i.e building=House, but also only key terms like Building. The query will be displayed on the left side. Remember that node are points (POI), way lines and relations are polygons (or a mix of points, lines, and polygons). If you only want a dataset containing points, remove way and relation from the query. To get a dataset containing all buildings within your city, move the map view to your city and just write building in the Wizard.

Click the run button on the top left and see the results of your query on the map on your right side. Remember that the query only runs within the bounding box of your map. To download the data click Export. If publishing the data you must cite the source of the data back to OpenStreetMap and Overpass Turbo in the descripton of your dataset.

Data © [OpenStreetMap]( contributors
Data mining by [Overpass API](

PS: For Norwegian readers, you can find a tutorial on how to extract OSM data here:

PS2: For readers that are not Norwegian a tutorial created by Carto can be found here:

Legg igjen en kommentar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

Du kommenterer med bruk av din konto. Logg ut /  Endre )


Du kommenterer med bruk av din Google konto. Logg ut /  Endre )


Du kommenterer med bruk av din Twitter konto. Logg ut /  Endre )


Du kommenterer med bruk av din Facebook konto. Logg ut /  Endre )

Kobler til %s

opp ↑

%d bloggere like this: