# Total road length in Kilometers for a country

 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 Florin 112●8●9●13 accept rate: 0% stephan75 12.6k●4●55●209

 0 You can use the free CartoType tool ctm1_info on a CartoType map. Both ctm1_info and the makemap tool to create CartoType maps are free for non-commercial use. For example, to get the total road length for Sweden: ``````ctm1_info sweden.ctm1 -n -aroad/ ctm1_info built using CartoType 6.3.9557 Layer 'road/' has 941,643 objects: line objects: 939,897; length = 482121.61 km polygon objects: 1746; area = 3.79 sq km `````` answered 15 Jan, 14:33 Graham 11●1 accept rate: 0%
 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) answered 30 Apr '20, 22:30 JOAO LUIZ 16●1 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. answered 18 Jun '15, 21:56 joost schouppe 3.4k●23●47●87 accept rate: 12%
 0 Perhaps this question helps. I am currently waiting for someone to confirm that this is a good approach :) answered 31 Oct '14, 23:23 mvexel 762●8●15●23 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. answered 16 Sep '12, 20:07 Badita Florin 112●8●9●13 accept rate: 0%
 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. answered 14 Sep '12, 19:26 Vclaw 9.2k●8●93●140 accept rate: 22%
 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:

×156
×18
×14

question asked: 14 Sep '12, 14:33

question was seen: 7,509 times

last updated: 15 Jan, 14:34