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

Hi, Everyone, I am pretty new to this treasure island, got two questions in the osm file format

  1. A road is split into several xml element (tagged "way"), how to merge them into one piece? Is there a relation element include all the road pieces into one road? If I want to calculate the length of a road, I can get all these pieces and sum them up, but I don’t particularly like this approach. Because you lost the order information (which piece is connected to another)

  2. Is there a node type/data for road intersection?

Thanks Shawn

asked 27 Aug '13, 15:57

Shawn's gravatar image

accept rate: 0%

edited 27 Aug '13, 20:54

MagicFab's gravatar image


The original question was: "way elements are pieces in osm file". Please make sure the question as re-phrased is correct.

(27 Aug '13, 20:54) MagicFab

In isolated cases there will be a relation that contains all the ways of a street but normally you are on your own - you have to combine the pieces by looking at the node IDs (if one bit ends at node #1234 and the other starts at #1234 then they probably belong together). This can be arbitrarily complex - two bits of the same street might be separated by e.g. a plaza or an intersection.

The same with intersections - we don't map them specifically; you will have to check if the same node ID is used by more than two street segments.

permanent link

answered 27 Aug '13, 16:05

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
accept rate: 23%

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: 27 Aug '13, 15:57

question was seen: 3,959 times

last updated: 27 Aug '13, 20:54

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