Data Primitive
A data primitive in OpenStreetMap is one of either a Node, Way or Relation. All of these can have one of more associated Tags and can be included as a member of one or more relations with an optional role.
Contents |
Node 
- Main article: node
A node defines a single geospatial point using a latitude and longitude. A third optional dimension, altitude, can be recorded; key:ele and a node can also be defined at a particular layer=* or level=*. Nodes can be used to define standalone point features be used to define the path of a way.
A town or village can be represented by a node with place=* and name=*. A node may also be used without tags as part of a way and where used in this way does not need to have any tags. In some cases nodes along a way do have tags (such as power=tower to represent a tower or pylon along a power line or building=entrance to identify the way into a building.
A node can be included as member of relation and may have an associated Role.
Way

- Main article: Way
The second primitive element is the way which is an ordered list of between 2 and 2000 nodes. Ways can be used to represent linear features (vectors) or polygons (areas).
A way can be included as member of relation and may have an associated Role. Ways of more that 2000 nodes will need to be split into two or more shorter ways. Where ways meet, for example at a road junction, they should share a node. Ways may be 'open' (where they do not share a first and last node) or 'closed' where they do. In some cases a closed way will be interpreted as a 'closed polyline' and in other instances as an Area and in some cases as both a closed polyline and an area. It is necessary to interpret the tags to review the tags associated with the way and in some cases the tags associated with any relations associated with the way.
Open polyline
An open Polyline is an ordered interconnection of between 2 and 2000 nodes describing a linear feature which does not share a first and last node. Many roads, streams and railway lines are described as open polylines.
Closed polyline 
A closed polyline is a polyline where where the last node of the way is shared with the first node. An example of a close vector is a roundabout (highway=tertiary + junction=roundabout).
Area 
- Main article: Area
An Area (also polygon) is an enclosed filled area of territory defined as a closed Way. Closed ways with some tags such as landuse=* are assumed to be areas, others, such as highway=footway are assumed to be closed Polylines unless they also have a area=yes tag.
Areas can also be described using the Multipolygon relation.
Combined Closed-polyline and Area
Where a way is tagged with tags that are interpreted as a 'Closed-polyline' and also as an Area then a single way can be used to create two features. For example a closed way tagged highway=primary + junction=roundabout + landuse=grass should be interpreted as a circular primary road roundabout containing an area of grass.
Relation 
- Main article: Relation
A Relation consists of an ordered list of nodes, ways and sometimes also other relations as member of the new relation. The relation can have tags and each element can also optionally also have a defined role within the relation. A single element may appear multiple times in a relation and a relation can be included as member of another relation.
Tag 
- Main article: Tag
A Tag consists of two free format textual fields, a 'key' and a 'value', each of which are Unicode strings of up to 255 characters. There are however many conventions on how individual features are best described. By way of example, a residential road is defined using a key of 'highway' and a value of 'residential' in the tag highway=residential. Keys may in addition use a namespace to further refine their purpose, so that maxspeed:winter=* indicates that there is a separate speed limit during the winter.
Common attributes
| name | value | description |
|---|---|---|
| user | string | The display name of the user who last modified the object. A user can change their display name |
| uid | integer | The numeric user id. of the user who last modified the object. The user id. number will remain constant. |
| timestamp | W3C Date and Time Formats | time of the last modification |
| visible | "true" "false" |
whether the object is deleted or not in the database, if visible="false" then the object should only be returned by history calls. |
| version | integer | The edit version of the object. Newly created objects start at version 1 and the value is incremented by the server when a client uploads a new version of the object. The server will reject a new version of an object if the version sent by the client does not match the current version of the object in the database. |
| changeset | integer | The changeset in which the object was created or updated. |
| Data Primitives | |
|---|---|
| Node • Way • Relation • Tag | |