NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi. I am new to OSM. I have extracted a rectangle of data for Welwyn Garden City, with a view to experimenting with routing algorithms. I have used osm1.c as an example to extract ways, nodes, relations. My question is how do I know which order to plot nodes to draw a way. I don't want to use any library to do this. Is this the order in the way XML data? For example Ingles (a street name) appears to have 20 nodes and no relations. This appears to be the case (order wise) for Ingles but is it generally true? Do 'relations' give this information for some ways.

asked 02 Jun '19, 21:56

Mike%20Begesford's gravatar image

Mike Begesford
accept rate: 0%

General information about the OSM xml format is available on the wiki and a simple example of how a way is recorded here. There are a few open source routing engines for osm data if you want to see how others have tackled the problem.

permanent link

answered 02 Jun '19, 22:58

InsertUser's gravatar image

accept rate: 19%

I just wanted 'yes' or 'no' from one of the experts out there!

(13 Jun '19, 12:18) Mike Begesford

Relations have nothing to do with this. This information is contained in the XML, specifically the order in which the way refers its nodes via <nd ref=... elements (i.e. not the order in which the <node> elements appear in the XML!).

(13 Jun '19, 12:25) scai ♦

Way nodes in (any format that I know are) are ordered in the data (so first node first and so on, closed ways end with a repeat of the first node).

permanent link

answered 14 Jun '19, 07:16

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 02 Jun '19, 21:56

question was seen: 2,234 times

last updated: 14 Jun '19, 07:16

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum