BBBikeDownloader.get_subregion_download_url¶
-
BBBikeDownloader.
get_subregion_download_url
(subregion_name, osm_file_format)¶ Get a valid URL for downloading OSM data of a specific file format for a geographic region.
- Parameters
subregion_name (str) – name of a geographic region available on BBBike free download server
osm_file_format (str) – format (file extension) of an OSM data
- Returns
a valid name of
subregion_name
and a download URL for the givenosm_file_format
- Return type
tuple
Examples:
>>> from pydriosm.downloader import BBBikeDownloader >>> bbbike_downloader = BBBikeDownloader() >>> region_name = 'leeds' >>> file_format = 'pbf' >>> # Get a valid subregion name and its download URL >>> rn, dl = bbbike_downloader.get_subregion_download_url(region_name, file_format) >>> print(rn) Leeds >>> print(dl) https://download.bbbike.org/osm/bbbike/Leeds/Leeds.osm.pbf >>> file_format = 'csv.xz' >>> rn, dl = bbbike_downloader.get_subregion_download_url(region_name, file_format) >>> print(rn) Leeds >>> print(dl) https://download.bbbike.org/osm/bbbike/Leeds/Leeds.osm.csv.xz