Elements

Elements and tags are the basic building blocks of all map data in OpenStreetMap. The database stores three types of elements:
Nodes – single coordinate points in space.
Ways – ordered chains of connected nodes defining linear features and area boundaries.
Relations – ordered lists of elements that define how multiple objects work together, where each member can have an optional role.
Tags are key-value pairs of text (such as
highway=residential or natural=water) that describe what an element is and what properties it has. Any element can carry tags to give it meaning. Without them, elements only store positions or structure.
Elements are not the same as points, lines, and areas on a map. Instead, elements and tags work together to form those shapes. For example, OpenStreetMap has no separate "area" or "polygon" element, so areas are built from closed ways or multipolygon relations.
- Main article: Node
A node is a single point on the Earth's surface, defined by its latitude and longitude in the World Geodetic System 1984 (WGS 84). Coordinates are stored to 7 decimal places (about 1 cm precision). Every node stores at least an ID number and a pair of coordinates.
Nodes are used in three ways:
- Standalone points: Unconnected features such as a park bench, water well, tree, or mountain peak.
- Part of one or more ways: Points that define the shape of a way. Two ways connect only when they share a node. If two ways cross without sharing a node, they are not connected. Most nodes on ways are untagged, though some have tags, such as
entrance=yeson a building wall orhighway=crossingwhere a footpath and a road have an intersection. - Member of a relation: A node included in a relation, optionally with a role describing its function (such as the
node of a turn restriction).via
- Main article: Way
A way is an ordered list of 2 to 2,000 nodes that forms a polyline. The 2,000-node maximum is an API limit. Although the API allows single-node ways, a way with fewer than 2 nodes cannot form a valid line or area. A way can include the same node more than once, such as in a closed way or a self-touching loop.
The order of the nodes gives every way a direction. Forward follows the node order, backward goes in reverse, and left and right are the two sides when facing forward. Direction matters for features such as one-way roads (oneway=yes), waterways (drawn downstream), and cliffs or retaining walls.
Ways come in two forms:
Open ways: Start and end at different nodes. Used for linear features such as roads, footpaths, rivers, and fences.
Closed ways: The first and last node in the list are the exact same node (sharing the same ID, not two separate nodes at the same coordinates), forming a loop. Closed ways can represent either:
Because a closed way can be either a loop or a filled area, software uses its tags to decide which one it is. Keys such as building=*, landuse=*, leisure=*, and natural=* are treated as areas by default, with linear exceptions like natural=cliff and natural=coastline. Keys normally used for lines, such as highway=* and barrier=*, are treated as hollow loops by default. You can override a default or clarify an ambiguous tag by adding area=yes to mark a closed way as a filled area (for example, a pedestrian plaza tagged highway=pedestrian or a wide man_made=pier) or by adding area=no to mark it as a hollow loop (for example, a circular leisure=track or a looped man_made=pier). See Way#Differences between linear and area representation of features.
A single way cannot represent an area that has holes (such as a building with an inner courtyard), consists of separate parts, or needs more than 2,000 nodes for its outline. A multipolygon relation must be used for these instead.
- Main article: Relation
A relation is an ordered list of elements (nodes, ways, or other relations) grouped together to describe a geographic or logical relationship. Each element in the list is called a member . The API limits a relation to 32,000 members.
Each member can have a role that describes its function in the relation, such as
and outer
in a multipolygon, or inner
, from
, and via
in a turn restriction. Depending on the relation type, the same element may appear multiple times as a member.
to
By convention, every relation has a type=* tag that defines what kind of relation it is and how software should read its members and other tags. Common relation types include:
- Multipolygons: Complex areas with holes, multiple outer parts, or outlines with more than 2,000 nodes.
- Routes: Ordered chains of roads, rails, or paths forming a numbered highway, bus line, cycle route, or hiking trail.
- Administrative boundaries: Borders of countries, states, regions, municipalities, and so on, assembled from multiple boundary ways.
- Turn restrictions: Traffic rules between connected roads, such as forbidding a turn from one way onto another via an intersection node.
Relations represent spatial or logical structures. They are not used to group unrelated objects into categories.
- Main article: Tag
All three element types, as well as changesets, can carry tags that describe what an object is and what properties it has.
A tag consists of a key and a value, each stored as UTF-8 text up to 255 characters long. The key indicates a category or property (such as
highway) and the value indicates a specific detail for it (such as
residential). Keys must be unique on any single element: an object cannot have both amenity=restaurant and amenity=bar at the same time. In some cases, multiple values can be combined using a semi-colon value separator, though not all software supports this.
OpenStreetMap does not have a fixed list of allowed tags (see Any tags you like), but mappers follow shared conventions that we try to document on this wiki.
Elements vs. geometries
Most map features use one of three basic geometries (points, lines, or areas), or a non-area relation. Editors like iD let you draw Points, Lines, and Areas and manage the underlying elements for you, while editors like JOSM let you work directly with raw nodes, ways, and relations.
Common attributes
In the OSM database, every node, way, and relation stores the following metadata attributes in addition to its tags and full editing history. Some third-party extracts do not include user or changeset metadata.
| Name | Value | Description |
|---|---|---|
id
|
integer (64-bit) | Unique identifier within its element type. Nodes, ways, and relations have separate ID spaces, so a node and a way and a relation could all have the same ID without being related in any other way. Because of this, when writing software, always identify an element by both its ID and its type. Existing and deleted elements use positive integers (greater than 0). Temporary negative IDs are used only during API v0.6 uploads to refer to newly created objects. |
user
|
character string | Display name of the user who last modified the element (informative only and may be empty). Display names can change at any time without increasing the element's version. |
uid
|
integer | Permanent numeric identifier of the user who last modified the element. |
timestamp
|
Time of the last modification without fractional seconds (e.g. 2026-06-15T14:30:00Z).
| |
visible
|
true or false
|
Whether the element is active in the database. Deleted elements have visible="false". They do not appear in current map data, but can be found in historical data such as history API calls, changeset downloads, replication diffs, and full-history dumps.
|
version
|
integer | Edit version of the element. Starts at 1 on creation and increases by 1 with each edit. The server rejects an upload if its version does not match the current version in the database.
|
changeset
|
integer (64-bit) | The changeset ID in which this version of the element was created or modified. |
Historical note: Before API v0.5 (2007), OpenStreetMap had a fourth element type, segments, which connected two nodes and were grouped together to form ways.
See also
- Features – how elements and tags combine to model real-world map features
- OSM XML – the XML serialization format for OSM elements and attributes
- API v0.6 – technical specification for reading and writing elements
| ||||||||||||||||||