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 stephan75 |
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 |
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 |
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, 22:30 JOAO LUIZ |
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 |