This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Getting nodes arranged in order as they actually are on the real world map

0

Hi, in the project that I am currently building, i need series of points (nodes) in orderly manner as i transverse along the way from one point to the other. In other words if I am traversing the way, the nodes need to be in the same order in the map data that they are in reality But when i downloaded the OSM data, some of the nodes did not follow a uniform progression on the along the way.

asked 08 Feb '22, 18:48

Segunlakata's gravatar image

Segunlakata
16131316
accept rate: 0%


2 Answers:

1

Not sure if I understood your question correctly. The order in which nodes in the downloaded XML file appear is irrelevant. Each way has <nd ref="..."/> elements where all nodes of the way are referenced in the correct order. So in order to determine the correct order of nodes for a way you have to look at this section. For more information see OSM_XML.

answered 09 Feb '22, 09:00

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

0

If I'm clear on what you're asking, that is, you need ways having a series of nodes with timestamps progressing in the direction the way was originally drawn, then the answer is no.

That's because a mapper can come along at a later date and add or delete nodes, for example, to improve the accuracy of the way. Also, ways are split and new nodes added for objects like bridges, number of lanes, or changes in maxspeed. There are any number of legitimate reasons that nodes might be added or deleted on ways.

I hope this helps answer your question.

answered 09 Feb '22, 01:22

AlaskaDave's gravatar image

AlaskaDave
5.4k76107164
accept rate: 16%

Source code available on GitHub .