Datatypes

OpenStreetMap element ID

ID osm_id

DatatypeNot PIIidentifierDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

Identifier of an OpenStreetMap element, that is a node, a way or a relation. IDs are positive 64-bit integers that are unique only within one element type, so node 100 and way 100 are different objects. Datasets write the ID as a bare number, with a type letter (n, w or r; N, W or R in Nominatim), or as type/number like in OpenStreetMap URLs. osm2pgsql stores relation IDs as negative numbers.

Categories
Geographic identifiers
Countries
Global (not tied to a country)
Languages
Common to most languages
Quality
80/100 · missing: mapping (Wikidata, Schema.org, ...), detector coverage
Metacrafter rules
no detection rule yet
Supported by tools
no tool record lists this type yet

Regular expression

^(?:-|[nwrNWR]|(?:node|way|relation)/)?[1-9][0-9]{0,18}$

Python re syntax.

Examples

ValueDescription
62422Berlin boundary relation, bare number
n164979149Mount Everest summit node, osmium type letter
w32965412Statue of Liberty way, osmium type letter
R62422Berlin boundary relation, Nominatim lookup form
relation/51701Switzerland boundary relation, OpenStreetMap URL form
-62422Berlin boundary relation as osm2pgsql stores it
0 invalidIDs start at 1
x62422 invalidunknown element type letter

Child datatypes

IDNameCategoriesCountriesDescription
osm_node_id OpenStreetMap node ID draft geo global Numeric ID of an OpenStreetMap node, a single point with a latitude and a longitude. Nodes mark points of interest and are the vertices of ways.
osm_relation_id OpenStreetMap relation ID draft geo global Numeric ID of an OpenStreetMap relation, a group of nodes, ways and other relations with roles. Relations model administrative...
osm_way_id OpenStreetMap way ID draft geo global Numeric ID of an OpenStreetMap way, an ordered list of nodes that forms a line such as a road, or a closed shape such as a building outline.

Translations

LanguageNameDescription
FrenchIdentifiant d'objet OpenStreetMap
RussianИдентификатор объекта OpenStreetMap

Sources

Use this record