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's gravatar image

accept rate: 0%

edited 02 Jan, 10:39

permanent link

answered 02 Jan, 15:23

nevw's gravatar image

accept rate: 10%

edited 03 Jan, 10:21

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

Yes you are correct.
I plotted the round trip using AllTrails and covered 13.6 km.
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

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.

alt text

permanent link

answered 02 Jan, 11:16

andy%20mackey's gravatar image

andy mackey
accept rate: 4%

edited 07 Jan, 16:59

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.

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.

alt text

permanent link

answered 02 Jan, 13:30

nevw's gravatar image

accept rate: 10%

edited 03 Jan, 16:23

Your answer
toggle preview

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](http://url.com/ "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 Jan, 10:10

question was seen: 312 times

last updated: 07 Jan, 16:59

powered by OSQA