3
2

Or in miles. How can you calculate the total road length for a country. Or a continent, or a city, etc etc

I installed Qgis and learned to play a little with it.

There i can select to have all roads except track. Or a lot of nice stuff you can do, but one thing that i cannot figure it out in Qgis is to calculate the length of a road. Or calculate the lenght of all the roads.

So i can download once per week and do a query, so i can tell to people that this week we have added 200 km more or roads.

asked 14 Sep '12, 14:33

Badita%20Florin's gravatar image

Badita Florin
1128913
accept rate: 0%

edited 15 Sep '12, 14:57

stephan75's gravatar image

stephan75
12.5k454209


5 Answers:
6

One option is to use this Perl script, which will calculate the length of roads in an OSM file: osm-length-2.pl For more details, see this post by Frederik Ramm on the talk mailing list: [OSM-talk] Statistics on road network length?

Some of the other posts in that mailing list thread may be helpful.

permanent link

answered 14 Sep '12, 19:26

Vclaw's gravatar image

Vclaw
9.2k893140
accept rate: 22%

0

Perhaps this question helps. I am currently waiting for someone to confirm that this is a good approach :)

permanent link

answered 31 Oct '14, 23:23

mvexel's gravatar image

mvexel
73281523
accept rate: 0%

0

For regular updates, Vclaw's answer is probably best. But I don't think what you were trying to do is difficult in qgis. Here's a tutorial.

permanent link

answered 18 Jun '15, 21:56

joost%20schouppe's gravatar image

joost schouppe
3.3k214684
accept rate: 12%

0

There is a python package that does exactly that.

It is basically a wrapper on top of Overpass that handles the calls.

It supports country-size regions :)

https://github.com/JoaoCarabetta/osm-road-length

It is super easy to use,

Install it: pip install osm-road-length

And run:

import osm_road_length from shapely import wkt

geometry = wkt.loads('POLYGON((-43.2958811591311 -22.853167273541693,-43.30961406928735 -23.035275736044728,-43.115980036084224 -23.02010939749927,-43.157178766552974 -22.832917893834313,-43.2958811591311 -22.853167273541693))')

length = osm_road_length.get(geometry)

permanent link

answered 30 Apr, 22:30

JOAO%20LUIZ's gravatar image

JOAO LUIZ
1
accept rate: 0%

-1

osm-length-2.pl i cannot make it work and the other alternative, that i forgot right now what it was, the link it`s no more.

permanent link

answered 16 Sep '12, 20:07

Badita%20Florin's gravatar image

Badita Florin
1128913
accept rate: 0%

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:

×144
×17
×14

question asked: 14 Sep '12, 14:33

question was seen: 5,787 times

last updated: 30 Apr, 22:30

powered by OSQA