Openstreetmap Data Types

osm_logo.png

The data of openstreetmap is stored in a relatively simple manner. Basically, we have three base datatypes:

  • Nodes are the most basic datatype and the only objects that actually contain geographical coordinates. A node may simply look like
    node id='12345' lat='48.9955' lon='8.3948'.
  • Ways are ambiguous. More or less, ways are just polygons, and can either describe a way or an area. Ways have no geoinformation itself, as they are relying on nodes:
    way id='23456' nd ref='12345' nd ref='12346'.
  • Relations have been introduced with API 0.5 and can be seen as data objects glueing together either nodes, ways, or both. Relations are used to model turn restrictions, routes, multipolygons and the like:
    relation id='34567' member type='node' ref='12345' role='' member type='way' ref='23456' role=''.
    The members of a relation can take a role to describe what they mean. In simple relations (like route releations) the role attribute often is left blank.

Simple plain text Tags are used to determine what kind of map feature a node, way or relation represents. A tag consists of a key-value-combination like amenity=bench, natural=water, highway=residential or route=ski. Mappers are invited to invent new tags whenever necessary. This freedom plays an important role concerning the success of the project.

Prior to API 0.5, we had Segments. A segment connected two nodes. First, tags have been applied directly to segments. Then, ways have been introduced which joined segments together. Since then, the tags have been applied to the ways instead of the segments. Segments caused some trouble (namely “unordered segments” for the old dogs) and have been abandoned during the introduction of API 0.5.

So nowadays we have nodes, ways, relations and tags. Easy, isn’t it? True for nodes, ways and tags. Not true for relations, though. Relations are difficult to create and edit, because they most often have no direct graphical representation in the editors. More or less they appear a bit flange-mounted on top of nodes and ways. Nevertheless they allow us to map things that otherwise would be difficult or impossible to model.

Comments are closed.