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

I would like to get the road network length in OSM for the Africa and a dataset by Country. And for each country the length within the boundaries of the selected key urban areas like the capital, largest cities, or major port cities.

In addition to length I would like to get data on road class (primary, secondary, tertiary), road surface type (paved, unpaved); road condition (good, fair, poor); and if possible an estimate of the traffic level in average number of vehicles per day (0-30, 30-100, 100-300, 300-1000, 1000-3000, more than 3000 veh/day).

Assuming many countries have limited data in OSM, has some already done an estimate of network length using alternative sources?. Thanks, Alberto

asked 18 Sep '15, 17:31

Alberto%20Nogales's gravatar image

Alberto Nogales
accept rate: 0%

edited 19 Sep '15, 13:20

aseerel4c26's gravatar image

aseerel4c26 ♦

Network length is easy to calculate: download OSM Africa data, select only highways (eg with osmfilter), upload to PostGIS and perform appropriate queries. You will also need a country boundary data set, for which Natural Earth will probably be adequately accurate (at least for a first iteration: it will probably lose many residential roads adjacent to the coast, so finer scale polygons will be needed eventually).

OSM does not hold any information on traffic frequency or road condition. Most roads in Africa will not have the surface type mapped.

permanent link

answered 19 Sep '15, 12:44

SK53's gravatar image

SK53 ♦
accept rate: 22%


I zoomed to a random location somewhere in the centre of Africa, and there are many surface tags on highways. So, OSM supplies road condition information at least in some parts of Africa. "OSM does not hold any information on […] road condition" is not true.

(19 Sep '15, 13:13) aseerel4c26 ♦

@aseerel4c26 The OP explicitly asked about road condition separately from surface, and it was in that sense that I answered them.

(21 Sep '15, 20:59) SK53 ♦

@SK53, oh, right, reading helps ("road surface type (paved, unpaved); road condition (good, fair, poor)"). okay … yes, "condition" may be less popular. We could count our "smoothness" tag as condition, can't we? Yes, seems to me much less popular than "surface".

(21 Sep '15, 21:10) aseerel4c26 ♦

The potential loss of "residential roads the coast" should not be significant compared with the total in the country. With regard to road condition I can provide definitions of Good, Fair, Poor using the International Roughness Index (IRI) by a given Road surface (paved or unpaved)to provide a consistent measurement of "smoothness".

(03 Feb '16, 19:05) Alberto Nogales

The osm2pgsql documentation includes an example of how to get road statistics for a city, which could be adapted to get road data for all countries in an extract.

permanent link

answered 22 Sep '15, 10:31

pnorman's gravatar image

accept rate: 18%

Is there any recent example of applying osm2psgsl to any city that I could take a look at? Preferably in the Africa Region or a developing country in Latin America or Eastern Europe.

(03 Feb '16, 19:25) Alberto Nogales

I'm working on a dataset that does (amongst others) just that, for all regions and countries in the world. But also with a time dimension: how much is mapped now, and what was the road length on january first of all the years since OSM started. That can give you a good idea of how complete the road network is. I could prioiritize Africa you give me a deadline.

It might be good to compare the results to CIA Factbook basic statistics on road network.

permanent link

answered 20 Sep '15, 09:11

joost%20schouppe's gravatar image

joost schouppe
accept rate: 12%

Please share the status on the world data set that you have worked. I also have worldwide data and been recently involved mostly in the Africa Region. Maybe we could test a few countries to start comparing results. I suggest Tanzania, Uganda, Ghana and Mozambique for which I have some detailed data. I also have some estimates for the entire Africa Region that could be useful.

(03 Feb '16, 19:11) Alberto Nogales

Mapbox has a website where the total mapped road length per country is compared with CIA data:

(04 Feb '16, 05:59) escada
  1. Download an OSM Extract in .osm.pbf
  2. Find an OSM relation with the city boundary you want then wget -O boundary.osm
  3. osmium extract -p region.osm extract.osm.pbf -o region.osm.pbf
  4. osmium tags-filter extract.osm.pbf w/highway=motorway,trunk,primary,secondary,tertiary,unclassified,residential -o roads.osm.pbf
  5. osmium export roads.osm.pbf -o roads.geojson
  6. geojson-stats roads.geojson
permanent link

answered 14 Jun '18, 08:46

aharvey's gravatar image

accept rate: 21%

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 18 Sep '15, 17:31

question was seen: 6,188 times

last updated: 14 Jun '18, 08:46

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