# Questions about OpenStreetMap basic elements

Hello,

I am trying to understand OSM’s basic elements.
I’ve been reading the wiki.openstreetmap, and googling a bit, but I still have some doubts in understanding them.
I apologize in advance for asking this kind of beginner question. I hope I am not breaking any rules by asking it?

At the moment I have an issue to understand what the “ways” are.
Here is a definition from the wiki.openstreetmap:

So if I understood correctly, a “way” is an OSM feature made of a polyline which is:

a) not closed (rivers, roads, boundaries between something?)
icon:

b) closed, and represents a footprint of some solid object: like a forest, a park lane, or building footprint. It also has no inner holes, and less or equal to 2000 nodes.
icon:

c) closed, but does not represent a footprint of any solid object. It also has no inner holes, and less or equal to 2000 nodes.
This kind of closed ways are used to represent ONLY the “junction=roundabout” tags, and nothing else?
icon:

Did I understand this correctly, or didn’t I?

Yikes… Let’s ignore for a moment those highly complicated tech definitions and semantics:

A “way” is a LINE - that’s really the whole secret

It is made up of several “nodes” - which are POINTS or dots.
If a line forms a “closed ring” (last point=first point) it’s possible to consider it an area - but only if wished.
Then there are “relations” - which are COLLECTIONS of lines and dots.
That is all there is in OSM.

To keep complexity at a bearable level the servers allows only max 2000 nodes for 1 single line, more are blocked. For fixing, that monsterline must be split into 2 or more parts.

In the beginning I found it confusing, because in real life a “way” is for walking or driving, but in OSM it simply means “drawing line”! (PS: the real-life-ways are called “highway” instead, also slightly confusing for a 30cm path in the grass)

For example a simple house is made up of a closed “way” with usually 4 “nodes”, forming a rectangle.
A street or hiking path consists of a “way” and “nodes” too.
A river as well.

A forest or a lake as well, often needing LOTS of nodes and SEVERAL ways as outer borderlines, depending on their size. And to make things more complicated, forests can have “holes” inside without trees, and lakes can have dry islands in the inside, without water. Such “inners” are of course drawn as lines (ways) too. And they must be “closed rings” too. And because the outer and inner ways of that forest belong together, you need to collect them into a “relation”.

There exist various relation types. Just 2 examples, the one for areas like forests is called “multipolygon”. “polygon” for closed rings with a number of nodes, “multi” for several of those. Another relation type is for long hiking or biking trails, leading over lots of different streets and paths. Those are collected together in a “route” relation.

Areas go like this:
Of course there must be a line around their outer border: a way forming a “closed ring”.
But whether or not that shall represent an “area” depends on how it is tagged:
If you give it a “building” or a “forest” tag or other obvious stuff, the rendering apps will assume automatically this ring is meant as “area” and will paint the inside with a color.
If you give it a “barrier=fence”, they will assume automatically that a fence shall only be painted along the outer borderline, not inside everywhere too. So, no area.
But sometimes it gets tricky: What if a closed ring is given a “highway=pedestrian” tag? Is that perhaps a pedestrian street going in a circle? Or is the whole inner area for pedestrians too? In such cases an additional “area=yes/no” tag must make it clear to the rendering apps.

Roundabouts are examples of possible closed ways that aren’t areas. They are not the only thing that can be like that. Many roundabouts are not coded as closed ways, and many “roundabouts” shouldn’t be coded as roundabouts, because they are actually traffic circles.

Thank you for the replies both wycbtma and hadw!

So by “line” you mean: linear geometric element? Is that correct?
The wiki.openstreetmap calls it “polylines” instead, which is at least to me, a more understandable term, as a line can indicate that this geometric element is straight and consisted of only 2 nodes. A polyline can be consisted of 2 or more nodes.

Can they be a collections of lines (polylines) and lines (polylines) as well?
The wiki.opentopography article suggests that.

So because those hiking paths and rivers consist of both “ways” and “nodes”, then they are “relations”?

So when a hiking or biking trails intersect (lead over) with other “ways” they need to be splitted at the exact location where they intersect with those ways? Is this correct?

This is very nice information! Thank you for the detailed reply wycbtma!!

Can you name the other OSM geometric elements which are closed ways, but are not areas?
wycbtma mentioned:

Any other ones?

@bernard1995 If you dive in and do a bit of editing and use the default editor on the website, it’ll take you through an introduction to OSM elements and how you can edit them. It might be useful to do that to see how things in XML relate to real-world features.

Hi SomeoneElse.

I am scared not to mess up something, as I am really a beginner. My knowledge is nonexistent.

How would you take me through an introduction to OSM elements?

It is not possible to list all the possible closed ways as OSM has a free tagging system, so anyone can invent a new one as soon as the list is made.

In terms of rendering, I think you will find that tools have a list of closed way types that should be treated as areas, but that is also open-ended. In general, they will treat unknown keys as not being areas, as they will for unknown tags where the area status of key is uncertain.

Regarding your examples, highway=pedestrian will be interpreted as a circular path, if given on its own, but if you have area=yes, it will be interpreted as an area.

Please don’t worry about mistakes - after you’ve edited something, you can always ask here if it looks OK to other people (and if you make a real mess of things - which you won’t - it’s fairly easy for someone just to undo everything and let you start again).

Maybe try adding details to a town where you live - names of shops, that sort of thing?

Yikes2…

There may be translation probs into your native language, and you sure are an extremely technically trained person, but just try to imagine you were still a 4 year old kid for a moment:
A “straight” LINE (made of 2 nodes) is a LINE.
A “polyLINE” (made of many nodes) is a LINE too.
Those special cases are just subsets of the common term “line”.

Regarding relations, with “leading over” I didn’t mean “across” (as in crossings), but “along” (like the line that a router app will show you)

Perhaps take a look at the definition pages for single elements on the server: There are pages for
http://www.openstreetmap.org/way/
http://www.openstreetmap.org/node/
http://www.openstreetmap.org/relation/

For example:
http://www.openstreetmap.org/way/73908707

And on a relation to see how its definition looks like.

Oops, bad relation example - must be a monster, took too long to retrieve for the server!
Anyone happen to have a simpler example at hand?

Thank you.

Ok. So when you said:

It means that: if long hiking, biking trails go over different streets and paths, they are NEVER made of a single way (line). But instead of parts of those different streets and paths over which they go?

I’ve read all three of those articles. Thank you.

Clicking on nodes worked.
Are those nodes, the nodes from which a way is made of?
Or are they nodes representing some sort of relation with the very way (stop points for example)?

When I click on the upper relation (http://www.openstreetmap.org/way/73908707), I get the following error message:

Ok. So when you said:

You meant: post the results of what you did, in here on forum, and I will look at them and tell you if they are right right of wrong.
This is the type of guiding you had in mind?

Yes - you can link either to a changeset on the main website, or to a general area.

My last change for example was http://www.openstreetmap.org/changeset/43693490 , and if you just copy the URL from the browser address bar when you’re looking at an area you’ll see something like http://www.openstreetmap.org/#map=18/52.07307/-3.53600 , which links directly to the area that you are looking at.

This is an example of a way that is part of a simple relation (all ways, no branches, no one way sections), and which is of a manageable size:

Relation: http://www.openstreetmap.org/relation/1119532 (Diana Princess of Wales Memorial Walk)

It is also part of a more complex relation: http://www.openstreetmap.org/relation/2716 (London Cycling Network, route 5).

It’s made up of a number of nodes, starting with http://www.openstreetmap.org/node/102965405 In this case, it is very straight, so all the nodes correspond to junctions, but if it were less straight, there would be extra nodes to indicate the general shape.

And this is an example of a relation being used to represent an area with a hole in the middle: http://www.openstreetmap.org/relation/2513347

Thank you SomeoneElse for willingness to help me. Do you mind if I open a new topic about this (about my first OSM edit)? In this one I would just like to ask a questions about the basic OSM elements.

Thank you for these examples hadw.

This is the part that makes me confused.
A “way” is basically a line made by a certain number of nodes. So the nodes are only a construction elements in this case.

However, if a “way” has some nodes attached to it (bus stops of a certain road for example), that are not upper mentioned construction nodes, then this kind of OSM element is called: a “relation”.

How do I know if the nodes you’ve just showed me are a construction nodes of the particular “way”, or are they part of some “relation”?

The distinction is between untagged nodes and tagged nodes. Nodes are not parts of relations just because they are tagged.

This is a node that is completely standalone: http://www.openstreetmap.org/node/836785679 (Cycle hire station not mapped as an area.)

And this is one that is part of a way: http://www.openstreetmap.org/node/2639233825 (Traffic lights on Park Lane)

(Whilst it is possible to have an untagged node that is not part of anything else, this is generally an error.)

What is an untagged node? A node which does not contain any tags?

Both your upper nodes contain tags. So they are both tagged nodes?

bernard, in OSM you are allowed to make mistakes!
Just start editing in the place you like, it’s preffered near you are, so you can survey the real world for yourself.

OSM and the docs are like any open wiki. You can colaborate in many other ways, like reading the docs, and improving them yourself or contacting the author and asking for clarification.

Sure - you can do it however you like (another thread on the forum, a PM via OSM’s message system, or whatever else works).

Yes and yes.

Objects of any type (node, way, or relation) aren’t required to have any tags on them. Depending on how the object is being used, though, tags may be essential to define what the object represents.

For example, let’s say we have a 5-node way that represents a road going around a corner. If we didn’t add any tags to the way, data consumers would have no way of knowing what real-world feature we intended this object to represent and it would be virtually useless. Since the real-world thing that’s being represented here is the road, we want to add tags to the way to indicate that’s what it is (like highway=residential). The 5 nodes are just there to define the shape of the way and don’t have any additional real-world meaning, so we don’t need to add any tags to them and can leave them untagged. However, if there was a traffic light at the location of one of these 5 nodes, we could add the tag “highway=traffic_signals” to represent it. In this case, that node is serving two purposes: to represent the traffic light, and to define the shape of the way.

Similarly, ways that define the shape of a relation can sometimes be left untagged. For example, let’s say we have two 1500-node ways that have their ends joined to make a complete circle in order to represent a large lake. Each of these ways is only there to define the shape of the relation and doesn’t represent any other real-world feature, so they can be left untagged. We then add tags to the relation to indicate that it represents the lake (e.g. “natural=water”).