osm xml schema

Hi, i have just exported a very small area a street name in London called Clipton street to see the type of information that goes into storing a, street name for example. Now even highlighting the street name shows a fair amount of xml code, i’ve been reading the wiki http://wiki.openstreetmap.org/index.php/XML_Schema#An_example to get an idea of what the tags mean which does help, but i still do not fully understand how these nodes/ways work in relation to a street name. Ofcourse, i understand that a node are the essential things to the schema with it’s lat/long values but if somebody were to ask me what does the following tages mean

<way id="4068450" visible="true" timestamp="2007-11-26T22:50:04+00:00" user="Paul Todd">
    <nd ref="110111"/>
    <nd ref="25502051"/>
    <nd ref="821601"/>
    <nd ref="822388"/>
    <nd ref="107349"/>
    <nd ref="21533907"/>
    <nd ref="25502829"/>
    <nd ref="107339"/>
    <nd ref="25496583"/>
    <nd ref="255563"/>
    <nd ref="9791156"/>
    <nd ref="25498605"/>
    <nd ref="108053"/>
    <tag k="created_by" v="Potlatch 0.5d"/>
    <tag k="name" v="Great Titchfield Street"/>
    <tag k="highway" v="unclassified"/>
  </way>

The fully xm code for the Great Titchfield street as follows:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.5" generator="OpenStreetMap server">
  <bounds minlat="51.521011" minlon="-0.14168" maxlat="51.521148" maxlon="-0.141106"/>
  <node id="821601" lat="51.5210332" lon="-0.1416605" user="andrewpmk" visible="true" timestamp="2007-08-17T00:35:58+01:00"/>
  <node id="107339" lat="51.5178184" lon="-0.1402721" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:19:09+00:00"/>
  <node id="107349" lat="51.5190954" lon="-0.1408729" user="Paul Todd" visible="true" timestamp="2007-11-26T22:50:11+00:00"/>
  <node id="108053" lat="51.5156027" lon="-0.1393518" user="randomjunk" visible="true" timestamp="2007-01-28T17:48:39+00:00"/>
  <node id="110111" lat="51.5229263" lon="-0.142436" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:51:40+00:00"/>
  <node id="255563" lat="51.516917" lon="-0.1398179" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:20:08+00:00"/>
  <node id="822388" lat="51.52036" lon="-0.1414065" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:28:09+00:00"/>
  <node id="822403" lat="51.5207716" lon="-0.1430501" user="80n" visible="true" timestamp="2007-01-29T08:48:13+00:00"/>
  <node id="823771" lat="51.5213881" lon="-0.1397757" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:28:00+00:00"/>
  <node id="9791156" lat="51.5163651" lon="-0.139566" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:20:14+00:00"/>
  <node id="21533907" lat="51.5185006" lon="-0.1406128" user="AcousticNewt" visible="true" timestamp="2007-01-28T09:23:07+00:00"/>
  <node id="21533910" lat="51.5211674" lon="-0.140948" user="andrewpmk" visible="true" timestamp="2007-08-17T00:35:59+01:00"/>
  <node id="21533912" lat="51.5209069" lon="-0.1423318" user="andrewpmk" visible="true" timestamp="2007-08-17T00:35:58+01:00"/>
  <node id="25496583" lat="51.5173639" lon="-0.140043" user="80n" visible="true" timestamp="2007-01-28T11:40:26+00:00">
    <tag k="created_by" v="JOSM"/>
  </node>
  <node id="25498605" lat="51.5159212" lon="-0.1394475" user="80n" visible="true" timestamp="2007-01-28T14:00:53+00:00">
    <tag k="created_by" v="JOSM"/>
  </node>
  <node id="25502051" lat="51.5222599" lon="-0.142184" user="AcousticNewt" visible="true" timestamp="2007-01-28T17:51:14+00:00"/>
  <node id="25502829" lat="51.5181262" lon="-0.14042" user="AcousticNewt" visible="true" timestamp="2007-01-28T18:22:57+00:00">
    <tag k="created_by" v="JOSM"/>
  </node>
  <node id="135791608" lat="51.521237" lon="-0.1406155" user="Paul Todd" visible="true" timestamp="2007-11-26T22:52:12+00:00"/>
  <way id="4068450" visible="true" timestamp="2007-11-26T22:50:04+00:00" user="Paul Todd">
    <nd ref="110111"/>
    <nd ref="25502051"/>
    <nd ref="821601"/>
    <nd ref="822388"/>
    <nd ref="107349"/>
    <nd ref="21533907"/>
    <nd ref="25502829"/>
    <nd ref="107339"/>
    <nd ref="25496583"/>
    <nd ref="255563"/>
    <nd ref="9791156"/>
    <nd ref="25498605"/>
    <nd ref="108053"/>
    <tag k="created_by" v="Potlatch 0.5d"/>
    <tag k="name" v="Great Titchfield Street"/>
    <tag k="highway" v="unclassified"/>
  </way>
  <way id="5090250" visible="true" timestamp="2008-05-03T12:16:45+01:00" user="Andy Allan">
    <nd ref="822403"/>
    <nd ref="21533912"/>
    <nd ref="821601"/>
    <nd ref="21533910"/>
    <nd ref="135791608"/>
    <nd ref="823771"/>
    <tag k="oneway" v="yes"/>
    <tag k="highway" v="unclassified"/>
    <tag k="created_by" v="Potlatch 0.8c"/>
    <tag k="name" v="Clipstone Street"/>
  </way>
  <relation id="12176" visible="true" timestamp="2008-08-09T17:55:39+01:00" user="Andy Allan">
    <member type="way" ref="4068452" role="forward"/>
    <member type="way" ref="4082616" role="forward"/>
    <member type="way" ref="4253466" role=""/>
    <member type="way" ref="4254996" role="backward"/>
    <member type="way" ref="4254997" role="forward"/>
    <member type="way" ref="4255009" role="forward"/>
    <member type="way" ref="4255103" role="forward"/>
    <member type="way" ref="4255109" role="forward"/>
    <member type="way" ref="4256129" role="forward"/>
    <member type="way" ref="5090250" role="forward"/>
    <member type="way" ref="17926237" role="backward"/>
    <member type="way" ref="17926240" role=""/>
    <member type="way" ref="17926241" role=""/>
    <member type="way" ref="17929790" role="forward"/>
    <member type="way" ref="17929795" role="forward"/>
    <member type="way" ref="17944924" role="forward"/>
    <member type="way" ref="17944925" role="forward"/>
    <member type="way" ref="17944927" role="forward"/>
    <member type="way" ref="17944928" role="forward"/>
    <member type="way" ref="19211502" role=""/>
    <member type="way" ref="19212465" role="forward"/>
    <member type="way" ref="26164616" role=""/>
    <tag k="ref" v="0"/>
    <tag k="type" v="route"/>
    <tag k="created_by" v="Potlatch 0.10b"/>
    <tag k="network" v="lcn"/>
    <tag k="route" v="bicycle"/>
  </relation>
</osm>

i would not know where to start or begin. This may sound a bit silly to you guys, but i just want to be confident with the data that i am working with. Could somebody provide me some sort of explanation of how this all works? or some links detailing how a street name can have so much xml code to it or better still a diagramatic view of how this is put together because right now, am a bit confused.

Cheers

Well, curiosity can hurt you but I’m sure you will figure it out… :wink: The page you linked to was a bad thing of the past. I have deleted it and linked it to a new page.

Anyways above you see the way contains <nd ref=“821601” that refers to the node that is sent later on (<node id=“821601”), then you draw lines between all those nodes that are refered from the way.

To change a way you take the code for the way make some changes, e.g. remove a <nd ref= line, and then send it as it where plus your change to the server. in your case you would only change the name tag of the way like this:

<way id="4068450" visible="true" user="Paul Todd">
    <nd ref="110111"/>
    <nd ref="25502051"/>
    <nd ref="821601"/>
    <nd ref="822388"/>
    <nd ref="107349"/>
    <nd ref="21533907"/>
    <nd ref="25502829"/>
    <nd ref="107339"/>
    <nd ref="25496583"/>
    <nd ref="255563"/>
    <nd ref="9791156"/>
    <nd ref="25498605"/>
    <nd ref="108053"/>
    <tag k="created_by" v="Potlatch 0.5d"/>
    <tag k="name" v="The Nvidia Street"/>
    <tag k="highway" v="unclassified"/>
  </way>

Then send it with OSM API to the server like this:

PUT /api/0.5/way/4068450
<include the way data here>

So, these nodes are they like points on a graph and are drawn between node to node given that lat/long position?
e.g


would be conected together
Apologise if these questions seem low level, just want to understand what is going on here but when you draw lines between the nodes these represent the road?

What does <bounds… > tag represent and this mean?

Cheers

No the graphs are defined by the order the nodes are listed in the by a list of , these are directed graphs… The only show you whre you have a point in the map, these may or may not be included in a way.

bounds just give you the bounds for the lat/lon in this current file…

and tag define information on the ways, e.g. you tag a motorway with the name “heinz road” to k=highway t=motorway and k=name t=“Heinz road”.

There… :slight_smile:

We really need help with improving the docs on this, is this is a good page describing it? I included examples from this discussion which might not be the best examles but I’m lazy… :slight_smile:

http://wiki.openstreetmap.org/index.php/Data_Primitives

Hi again,

thanks for your response, much appreciated. I agree that the doc does really need some home improvement - i think a very basic graph showing how the Cliptone Street would also be very beneficial as i think that even though there is the illustration of the node, way and closed way is there which is very useful, it does not provide a visual aid of how a street which in this case Cliptone street in is constructed in a graph level. What do you think?

Guys, from my understanding these nodes they represent points on a map which is a data primitive that has a number of attributes e.g id etc. While a way is a list of at least 2 nodes describing something lineer like a street. The streets are constructed in the order of the nd ref tags in the ways and the <tag … essentially provides the info of the node/way created which could be the name of the street. Am i correct?
Cheers

You don’t need on ways but it does help if you want to see them. So yes you are right,

The naming “way” is a bit misleading, especially when used in a cartography context. It would be less confusing if, when already using the term “nodes”, the term “line” or “edge” for a connected set of nodes would have been used.
Nodes and ways get a meaning only by tagging. A way can be a river, house, borderline or, err, way, road, …
I like the slim design of .osm. Only a few node types with few attributes, but the attributes can take many values. This gives plenty of flexibility without having to change the .osm-DTD every now and then. But, of course, it also gives the flexibility to give attributes that will never make it to a map :wink:

mm… True… but edge is too academic, I think way was choosen because the first idea was to make a streetmap and all street are ways.

I’ve been thinking more and more in the lines of converting nodes+ways to linestrings plus some kind of relation to show where they join with each other… But the “slim design” you are talking about might be effected by that, not sure if it’s alot harder to understand nodes+ ways or Linestrings+relations…

Do you think that the wiki page should be updated soon with more content perhaps? or slightly changed to help emphasis theyou are points you are describing?

cheers