From OpenStreetMap Wiki
(Redirected from Data Primitives)
Jump to navigation Jump to search


  • nodes (defining points in space),
  • ways (defining linear features and area boundaries), and

All of the above can have one or more associated tags (which describe the meaning of a particular element).

Node node

Main article: Node





Way way closed way area

Main article: Way





Relation relation

Main article: Relation







Tag tag

Main article: Tag

All types of data element (nodes, ways and relations), as well as changesets, can have tags. Tags describe the meaning of the particular element to which they are attached.

A tag consists of two free format text fields; a 'key' and a 'value'. Each of these are Unicode strings of up to 255 characters. For example, highway=residential defines the way as a road whose main function is to give access to people's homes. An element cannot have 2 tags with the same 'key', the 'key's must be unique. For example, you cannot have an element tagged both amenity=restaurant and amenity=bar.


Not all elements have tags. Nodes are often untagged if they are part of ways. Both ways and nodes may be untagged if they are members of a relation.

Common attributes


Name Value Description
Positive (>0) values are used for all existing elements (and will remain assigned when they are modified or deleted); negative values (<0) are reserved (their scope limited to the current changeset and never stored in the database) and only used when sending data to the OSM database for identifying new objects to create and reference them in other created or modified objects (the server will replace these temporary identifiers sent by the editing application, by assigning an actual positive identifier for each created object, and will return a mapping from the negative identifiers used to their assigned positive identifiers).
user character string The display name of the user who last modified the object (informative only and may be empty). A user can change their display name at any time (existing elements will reflect the new user name without needing any version change).
uid integer The numeric identifier of the user who last modified the object. An user identifier never changes.
timestamp W3C standard date and time formats. Time of the last modification (e.g. "2016-12-31T23:59:59.999Z").
visible "true" or "false" Whether the object is deleted or not in the database, if visible="false" then the object should only be returned by history calls.
changeset integer The changeset number in which the object was created or updated (supporting 64-bit is recommended in applications for compatibility with long term evolution of the OSM database, but applications that only query data without updating them may ignore this informative attribute).

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

See also