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

Hello,

I am using osm-length-2.pl script to summarize road length of a country. The script is working well except it outputs the first type of highway with an empty name:

highway length sums (metres):

                  38856413m
track              7762817m
secondary          1941725m
residential        1747145m
service            1315326m
path               1080010m
primary             927921m
footway             881391m
...
TOTAL             56823848m

Does anyone have this issue?

This question is marked "community wiki".

asked 08 Sep '16, 04:34

trungnk's gravatar image

trungnk
11115
accept rate: 0%

edited 08 Sep '16, 04:45


The script sums up the lengths of all ways, not only highways, and the first number is the length of all non-highway ways. I have modified the script in SVN to stop doing that, so if you check out a new version the first line will be gone.

permanent link

answered 08 Sep '16, 09:46

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks Frederik. I can see the filters are updated. From osm highway definition almost covers all the type of road. Do the non-highways ways you mentioned are relations?

(09 Sep '16, 00:53) trungnk
1

Ways and relations are different things, see elements. Non-highway ways can be buildings, landuses, water bodies, forests, parks, railways, walls and fences, ways for administrative boundaries and so on.

(09 Sep '16, 07:47) scai ♦

So the non-highway ways are not ways. They take a significant amount of length when the script calculates length of roads. Thus when comparing to the statistic data obtainted we see there are a half kilometres amout deducted after removing non-highways "things"

(09 Sep '16, 13:55) trungnk
1

They are ways, OSM ways :)

(09 Sep '16, 14:25) scai ♦

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:

×4
×1

question asked: 08 Sep '16, 04:34

question was seen: 1,621 times

last updated: 09 Sep '16, 14:25

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