[[TranslatedPages]] = Objects - The basic building blocks of OSM data and maps = Please don't hurry reading this, you can consult this page again at any second. [[PageOutline(2-10,Table of Contents)]] == Nodes, ways, and relations == #NodesWaysRelations === Tags (also an OSM data primitive) === #Tags Tags provide meaning to the objects. Without them, any other object would be useless and meaningless. Each of ''three other data primitives'' '''can have multiple tags'''. [=#Often tags used in combinations; '''presets usually these combinations can be found] in [wiki:Presets presets]'''. But it may be true that tags you need to use are not in presets and you need to know them first. Simplest example is [osmwiki:Key:drinking_water drinking_water=yes] - it is present globally and can be applied to every object that provides water. Other example is [osmwiki:Key:leaf_cycle leaf_cycle]=* of trees, it will have less coverage globally (as trees do not grow just everywhere). From time to time you will encounter tags that found somewhere else but not in your locality; it is good idea to check wiki what is tag about, use: [osmwiki:Essential_links_tagging Essential links tagging] as starting point. We will cover tags in more detail below, but first will cover all other data primitives. === Nodes (also an OSM data primitive) === #Nodes [[Image(source:trunk/images/data/node.png,20,bottom,margin-right=15,nolink)]] A **node** is an individual point with a defined position. ''With respective tags'' it can be used to indicate shops, benches, individual trees or points of drinking water. === Ways (also an OSM data primitive) === #Ways [[Image(source:trunk/images/data/way.png,20,middle,margin-right=15,margin-bottom=5,nolink)]] A **way** is a sequence of nodes. OSM **way** used to represent linear objects, ''with respective tags'' it can used to describe: a river bank, tree row, kerbs in the streets (among other uses). ==== Areas ==== #ClosedWays [[Image(source:trunk/images/data/closedway.png,20,middle,margin-right=15,margin-bottom=5,nolink)]] If a **way** is closed, i.e. if the last node is the same as the first node, it is also called an **area**. Old term for this is ''Closed Ways'' (it is still present at wiki, used in software and by some mappers; other part uses "geometry" when talking just about shape of the objects, without tags). Sometimes single area is not enough to represent an object (for example, a lake with an island in it), then you have to use a [wiki:Help/Concepts/Object#typemultipolygon multi-polygon] === Relations (also an OSM data primitive) === #Relations ==== In most cases you don't need them ==== If some object can be represented with single ''node'' or ''way'' and ''multiple tags supported by software'', then there is no need in relations. But there are some rare cases where it is theoretically and practically impossible ''only with nodes, ways and tags'' (ex. turn restrictions, will be covered below). ==== Simple explanation ==== [[Image(source:trunk/images/data/relation.png,20,middle,margin-right=15,margin-bottom=5,nolink)]] A **relation**: * is a sequence of other objects (nodes, ways and relations) * as other objects (node, way) - every relation can have their own "tags" * can be used as members in other relations (nested or hierarchical structures) * tag type=* used to define one of [http://wiki.openstreetmap.org/wiki/Types_of_relation many types of relations] Additionally, each object participating in a **relation** can be assigned a **role**, for instance "via" node and "from", "to" ways in type=restriction relation. ==== Most popular types ==== ===== type=multipolygon ===== A water object (natural=water), a building (building=*) or administrative boundary (admin_level tag). (stub) ===== type=route ===== Used to describe bus routes and train routes along other transportation services. (stub) ===== type=restriction ===== Can used to describe turn restriction according to signs and road marking. JOSM has a plug-in to support this type of relations: http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Turnrestrictions http://wiki.openstreetmap.org/wiki/Relation:restriction#Examples == Tags == A **tag** is a name/value pair assigned to an object. Tags are used to describe an object in detail. If we write `foo`=`bar` we mean ''The tag with key foo is assigned the value bar''. Here are some examples: * `name`=`Main road` assigned to a way. This tag indicates that the name of the way is `Main road`. * `amenity`=`restaurant` assigned to a node. This tag indicates that the node represents a restaurant in the real-world. * `route`=`bus` assigned to a relation. This tag indicates that the relation represents a bus route. Tags can be combined. An object can carry as many tags as necessary. Here's a more complex example: {{{ highway=residential name=Main road name:en=Main road name:de=Hauptstraße maxspeed=30 hgv=no oneway=yes }}} Assigned to a way, this set of **tags** indicate, that the way represents a road in a residential area with name ''Main road'' (the German name be ''Hauptstraße'', the English name, which in this example equals to name, is ''Main road''). Speed is limited to 30km/h and heavy goods vehicles (hgv) are not allowed. Furthermore, it's a one way street. You are free to assign an object whatever tag you feel necessary. However, there is a list of so called [osmwiki:Map_Features Map Features], i.e. a canonical list of **tags** with a well-defined meaning which are often used by mappers. Whenever possible you are advised to stick to these tags because map renderers, routing engines, and other pieces of software rely on them. In the [[Image(source:trunk/images/dialogs/propertiesdialog.svg,18,middle)]] [Dialog/TagsMembership Tags/Membership Dialog] you can assign tags to an object, remove tags from an object, or edit assigned tags. == Object ids == The OSM server assigns each object a unique number, the **object ID** or **OSM ID**. A new object doesn't have an ID (it's ID is 0) until it is uploaded the first time to the OSM server. * Under **''Preferences -> [[Image(source:trunk/images/preferences/display.png,18,middle)]] [Preferences/Display Display Settings] -> Look and Feel''** it is possible to en- or disable the display of objects ids in the toggle dialogs. * With **''File -> [[Image(source:trunk/images/downloadprimitive.png,18,bottom)]] [Action/DownloadObject Download object ...]''** it is possible to download **objects** by Ids. * **''View -> [[Image(source:trunk/images/info.png,18,bottom)]] [Action/InfoAboutElements Advanced info]''** opens separated windows with informations about selected objects in text format. * **''View -> [[Image(source:trunk/images/info.png,18,bottom)]] [Action/InfoAboutElementsWeb Advanced info (web)]''** opens the **objects' pages** of selected objects on the [osmwww: OSM website] in your web browser. Alternatively, you can browse the objects directly by entering following address in your web browser: {{{ https://www.openstreetmap.org/browse/[node/way/relation]/[ID] }}} == Object versions == Each object has a **version**. The **version** is incremented whenever the object is uploaded to the server and the OSM server not only stores the most recent version of an object, but it's complete **history**. * **''View -> [[Image(source:trunk/images/dialogs/history.png,18,bottom)]] [Action/ObjectHistory History]''** opens the History Browser. The History Browser will show you the **versions** of a particular object. * Alternatively, **''View -> [[Image(source:trunk/images/dialogs/history.png,18,bottom)]] [Action/ObjectHistoryWeb History (web)]''** opens a page on the [osmwww: OSM website] in your web browser which displays the object history, too. ---- Back to [wiki:/Help Main Help]