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

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 '21, 10:10

tbus's gravatar image

tbus
41113
accept rate: 0%

edited 02 Jan '21, 10:39


permanent link

answered 02 Jan '21, 15:23

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

edited 03 Jan '21, 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 '21, 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 '21, 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 '21, 11:16

andy%20mackey's gravatar image

andy mackey
13.2k87143285
accept rate: 4%

edited 07 Jan '21, 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.
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.

alt text

permanent link

answered 02 Jan '21, 13:30

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

edited 03 Jan '21, 16:23

Follow this question

By Email:

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

By RSS:

Answers

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:

×25

question asked: 02 Jan '21, 10:10

question was seen: 1,665 times

last updated: 07 Jan '21, 16:59

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