Road length per country¶
Single country¶
-
scripts.length.
single_country
(country, continent_osm, base_path, overwrite=True, savefig=False, report=False)[source] Function to estimate the road length for each road segment in a country.
- Args:
country : The country for which we calculate the RAI.
continent_osm : The continent the country ‘belongs’ to. This is required for the osm extraction.
base_path : Base path to location of all files.
- Returns:
- The distance per road type (Primary, Secondary, Tertiary, Track, Other) for the specified country as pandas Series.
All countries¶
-
scripts.length.
all_countries
(base_path, multiprocess=True, overwrite=True, savefig=False, report=False)[source] Main function to estimate the length of all the roads and countries we are interested in.
- Args:
base_path : Base path to the location of all files and directories in this project.
multiprocess : Set to True by default. Set to False in the case of limited processing power.
overwrite : Set to True by default. This relates to all input data (i.e. .poly files, .osm.pbf files and shapefiles).
savefig : Set to False by default. When set to True, it will return a figure with the roads of a country.
- Returns:
- An Excel file with the length of all Primary, Secondary, Tertiary, Track and Other roads for each country.