Elements

From OpenStreetMap Wiki
(Redirected from Element)
Jump to: navigation, search
Help
Available languages
Deutsch English Español Français Magyar Italiano 日本語 Nederlands Русский Slovenčina Svenska Українська

Elements (also data primitives) are the basic components in OpenStreetMap from which everything else is defined. These consist of Nodes (which define a point in space), Ways (which define a linear features and areas), and Relations - with an optional role - which are sometimes used to define the relation between other elements. All of the above can have one of more associated tags.

Contents

Node 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 way closed way area

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 way

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 closed way

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 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.

Relation 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 tag

Main article: Tag

A Tag should perhaps not be regarded as an "Element" in it's own right, but rather it is a small unit of data attached to one of the above elements. 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' to form 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

Nodes, Ways and Relations have the following attributes in common i.e. we store these fields for every element.

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.

Of course in addition we store the tags, and also a full editing history of every element.

Elements
Node • Way • Relation (members and roles) • Tag (key and value)
Personal tools
Namespaces
Variants
Actions
site
Toolbox