A Tag consists of 'Key' and a 'Value' and are used to describe elements (nodes, ways and relations) or changesets. Both the key and value are free format text fields, although in practice there are agreed conventions of how tags are used for most common purposes.
Keys and values
Tags are written in OSM documentation as Key=value. a Key broadly describes an element (for example, highway or name). Each tag consists of only one key. The value more specifically describes its accompanying key.
Here are a few examples of how keys and values are used in practice:
- highway=residential (a tag with a key of 'highway' and a 'value' of residential which should be used on a Way to indicate a road along which people live.
- name=* (a tag for which the value field is used to contain the name of the particular street
- maxspeed=* (a tag for which the value is often a numeric speed, either in km/h (or in miles per hour if a suffix of 'mph' is provided). Metric units do not need to define units, other units, such as miles per hour, knots, yard or pounds should do. Where a regulation is specified in a particular unit then that unit should be used within the value field.
- maxspeed:winter=* (a key which includes a Namespace for 'maxspeed' that identifies a different value for maxspeed that applies in the winter.
Finding your tag
The following resources are often used to find an appropriate tag or explore tag usage:
- Map Features (a extensive list of the the most commonly used tags)
- Taginfo (A useful site to exploring current tag usage, including tag values that are not necessarily documented)
- Tagwatch (A similar service)
- OSM Semantic Network: a machine-readable structure containing the OSM tags