BBBikeDownloader.get_download_index¶
-
BBBikeDownloader.
get_download_index
(update=False, confirmation_required=True, verbose=False)¶ Get a dict-type index of available formats, data types and a download catalogue.
- Parameters
update (bool) – whether to (check on and) update the package data, defaults to
False
confirmation_required (bool) – whether asking for confirmation to proceed, defaults to
True
verbose (bool or int) – whether to print relevant information in console, defaults to
False
- Returns
a list of available formats, a list of available data types and a dictionary of download catalogue
- Return type
dict
Examples:
>>> from pydriosm.downloader import BBBikeDownloader >>> bbbike_downloader = BBBikeDownloader() >>> # Index for downloading OSM data available on the BBBike free download server >>> dwnld_dict = bbbike_downloader.get_download_index() >>> list(dwnld_dict.keys()) ['FileFormat', 'DataType', 'Catalogue'] >>> catalogue = dwnld_dict['Catalogue'] >>> type(catalogue) dict >>> list(catalogue.keys())[:5] ['Aachen', 'Aarhus', 'Adelaide', 'Albuquerque', 'Alexandria'] >>> catalogue_leeds = catalogue['Leeds'] >>> type(catalogue_leeds) pandas.core.frame.DataFrame >>> catalogue_leeds.head() Filename ... LastUpdate 0 Leeds.osm.pbf ... 2021-03-27 19:42:55 1 Leeds.osm.gz ... 2021-03-27 23:54:36 2 Leeds.osm.shp.zip ... 2021-03-28 00:08:26 3 Leeds.osm.garmin-onroad-latin1.zip ... 2021-03-28 01:12:19 4 Leeds.osm.garmin-onroad.zip ... 2021-03-28 01:11:50 [5 rows x 5 columns]