Data Primitives
From OpenStreetMap
A data primitive is an object class that can be stored via the API in the server. Several different logical things (like "Point Of Interest", "Street", "Tram Line", "Bus Stop" etc.) are defined out of these primitives by specifying appropriate Map Features.
Every object has at least the following data:
- id
- The identifier in the database. Unique across this specific data type. An integer greater than 0.
- user, timestamp
- the author and time of the last modification.
- tags
- The properties of the object. A list of key/value pairs (both are simple, user defined strings). The meaning of the properties are up to the interpreting application but should be Map Features.
Contents |
Nodes, Ways, Relations
Data primitives are either nodes, ways, or relations.
Node
A node is a latitude/longitude pair. It is used as building blocks for other features and/or as features themselves (Points Of Interest) if they're tagged as required.
- id
- An integer greater or equal than 1. (Note that the ids are not unique, a way can have the same id as a node)
- tags
- A set of key/value pairs, with no key occurring twice. See Map Features for tagging guidelines.
- lat
- Latitude coordinate. Number between -90 and 90. Some applications may not accept latitudes above/below +-85. Stored to 7 decimal places.
- lon
- Longitude coordinate. Number between -180 and 180. Stored to 7 decimal places.
Way
A way is a list of at least two nodes that describe a linear feature such as a street, or similar. Nodes can be members of multiple ways.
- id
- See above
- tags
- See above
- nodes
- A list of all node ids.
Closed Way
A closed way is a way where the last and first node are identical.
This way can then be tagged according to any of the tags listed in Map Features.
Area
There is no data primitive for Areas.
A closed way becomes an area by tagging it with the appropriate keys for areas. (natural=water for example)
Relation
A relation is a group of zero or more primitives with associated roles. It is used for specifying relationships between objects, and may also model an abstract object.
- id
- See above
- tags
- See above
- members
- A list of primitives with associated "role" attributes (where "role" may be any text).

