# Compute length of a bus route

 1 Looking at a bus route like this one, I would like to know how I could compute the total distance of the route. I can see that the route is compose of "ways" that I can export to XML. Adding up the lengths of all the "ways" comprising a route should give me what I want. But there is no length information nor any begin/end position in the XML. How can I get the length information about the "ways" comprising a route? asked 02 Jan, 10:10 tbus 41●1●1●3 accept rate: 0%

 1 You could also use the Relation Analyzer https://wiki.openstreetmap.org/wiki/Relation_Analyzer http://ra.osmsurround.org/analyzeRelation?relationId=299720&_noCache=on answered 02 Jan, 15:23 nevw 9.0k●25●86●162 accept rate: 10% This is what I was looking for, thank you! Unfortunately I believe either the ways measurements or something else is wrong, because the real total length is considerably longer than that (~14 km vs 10.3km). (02 Jan, 15:59) tbus 1 Yes you are correct. I plotted the round trip using AllTrails and covered 13.6 km. https://www.alltrails.com/explore/map/sun-03-jan-2021-10-17-979a3f1 I assume the parts of the route where the bus follows the same part of the road in each direction count once unfortunately? Maybe one of the public transport apps that use the OSM data solve the task. (03 Jan, 10:37) nevw
 0 I haven't used an XML file but GPS Babel might convert it to a GPX. The GPX could then be read by several mapping apps to read the distance you want. I rough solution could be to use the route arrow on the map page to measure sections of the bus route. answered 02 Jan, 11:16 andy mackey 12.4k●80●134●271 accept rate: 4%
 0 Using JOSM: You could copy the relation id from the link you gave. In JOSM File>Download object (in this case it will be relation 299720), then select the object via Selection>Select all. Then activate the measurement tool via Windows>Measured values or activate it from the edit toolbar along the left side. You will see the 'selection length'. You can change the units used by clicking on the ruler icon along the bottom strip of the screen. The measurement tool is a plugin and you may also need the utilsplugin2, also may need to check 'Expert Mode' at the bottom left of the plugins page. JOSM>Preferences>Plug-ins Edit: distance of total bus route is incorrect because segments of road that are travelled in both directions are only counted once in the measured total. answered 02 Jan, 13:30 nevw 9.0k●25●86●162 accept rate: 10%
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×25