BBBikeDownloader

class pydriosm.downloader.BBBikeDownloader(download_dir=None)[source]

Download OSM data from BBBike free download server.

Parameters:

download_dir (str | None) – (a path or a name of) a directory for saving downloaded data files; if download_dir=None (default), the downloaded data files are saved into a folder named 'osm_data' under the current working directory

Variables:
  • valid_subregion_names (set) – names of (sub)regions available on BBBike free download server

  • valid_file_formats (set) – filename extensions of the data files available on BBBike free download server

  • subregion_index (pandas.DataFrame) – index of download pages for all available (sub)regions

  • catalogue (pandas.DataFrame) – a catalogue (index) of all available BBBike downloads

  • download_dir (str | None) – name or pathname of a directory for saving downloaded data files (in accordance with the parameter download_dir)

  • data_pathnames (list) – list of pathnames of all downloaded data files

Examples:

>>> from pydriosm.downloader import BBBikeDownloader
>>> import os

>>> bbd = BBBikeDownloader()

>>> bbd.NAME
'BBBike'

>>> bbd.LONG_NAME
'BBBike exports of OpenStreetMap data'

>>> bbd.URL
'https://download.bbbike.org/osm/bbbike/'

>>> os.path.relpath(bbd.download_dir)
'osm_data\bbbike'

>>> bbd = BBBikeDownloader(download_dir="tests\osm_data")
>>> os.path.relpath(bbd.download_dir)
'tests\osm_data'

Attributes

CITIES_COORDS_URL

URL of coordinates of all the available cities.

CITIES_URL

URL of a list of cities that are available on the free download server.

DEFAULT_DOWNLOAD_DIR

Default download directory.

FILE_FORMATS

Valid file formats.

LONG_NAME

Full name of the data resource.

NAME

Name of the free downloader server.

URL

URL of the homepage to the free download server.

Methods

download_osm_data(subregion_names, ...[, ...])

Download OSM data (of a specific file format) of one (or multiple) geographic (sub)region(s).

download_subregion_data(subregion_name[, ...])

Download OSM data of all available formats for a geographic (sub)region.

file_exists(subregion_name, osm_file_format)

Check if a requested data file of a geographic (sub)region already exists locally, given its default filename.

get_catalogue([update, ...])

Get a dict-type index of available formats, data types and a download catalogue.

get_coordinates_of_cities([update, ...])

Get location information of all cities available on the download server.

get_names_of_cities([update, ...])

Get the names of all the available cities.

get_subregion_catalogue(subregion_name[, ...])

Get a download catalogue of OSM data available for a given geographic (sub)region.

get_subregion_download_url(subregion_name, ...)

Get a valid URL for downloading OSM data of a specific file format for a geographic (sub)region.

get_subregion_index([update, ...])

Get a catalogue for geographic (sub)regions.

get_valid_download_info(subregion_name, ...)

Get information of downloading (or downloaded) data file.

get_valid_subregion_names([update, ...])

Get a list of names of all geographic (sub)regions.

validate_file_format(osm_file_format[, ...])

Validate an input file format of OSM data.

validate_subregion_name(subregion_name[, ...])

Validate an input name of a geographic (sub)region.