Nodes, ways, relations and
tags are the fundamental data structures in
OpenStreetMap:
- A node is a coordinate, consisting of a lattitude and a longitude.
- A way is an ordered list (array) of nodes.
- A relation is an ordered list of nodes, ways and even other relations. Each member in this set is assigned a role.
Tags
Colons
A colon typically specifies a hierarchical nature (name
, name:en
, name:de
…)
Real-world and other attributes
Most tags describe real-world features.
Other tags, such as source
or created_by
are not related to the physical thing being mapped.
And then there are also some tags such as note
, description
, fixme
, start_date
, survey:date
etc.
Implication of tags on ways
Some tags, when applied on ways, imply a multipolygon (for example: landuse
) while others imply lines (such as highway
).
There are even cases, where a tag can imply both (man_made=pier
).
Historical notes
The current OSM data model (nodes, ways, and relations) has evolved from an earlier model with
- nodes,
- segments (which connected exactly two nodes)
In 2005, segments were removed an relations were added.
Apparently, there was some support for an area datatype before this change. But with the removal of segments, the area datatype is gone, too.
Changesets were introduced in 2007.
Limits
There are some limits, for example:
- A way can contain a maximum of 2000 nodes
- A relation can contain a maximum of 32000 members
Such limits can be queried using the OSM API request GET /api/0.6/capabilities
:
$ URL=https://api.openstreetmap.org
$ VERSION=0.6
$ API=$URL/api/$VERSION
$ curl $API/capabilities
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<api>
<version minimum="0.6" maximum="0.6"/>
…
<waynodes maximum="2000"/>
<relationmembers maximum="32000"/>
…
<status database="online" api="online" gpx="online"/>
</api>
…
</osm>