BBBikeReader

class pydriosm.reader.BBBikeReader(data_dir=None, max_tmpfile_size=None)[source]

Read BBBike exports of OpenStreetMap data.

Parameters:
  • data_dir (str | None) – (a path or a name of) a directory where a data file is; if None (default), a folder osm_bbbike under the current working directory

  • max_tmpfile_size (int | None) – defaults to None, see also gdal_configurations

Variables:
  • downloader (BBBikeDownloader) – instance of the class BBBikeDownloader

  • name (str) – name of the data resource

  • url (str) – url of the homepage to the BBBike free download server

Examples:

>>> from pydriosm.reader import BBBikeReader
>>> bbr = BBBikeReader()
>>> bbr.NAME
'BBBike'

Attributes

DEFAULT_DATA_DIR

Default download directory.

FILE_FORMATS

Valid file formats.

LONG_NAME

Full name of the data source.

NAME

Name of the data source.

data_dir

Name or pathname of a data directory.

data_paths

Pathnames of all data files.

Methods

cdd(*sub_dir[, mkdir])

Change directory to default data directory and its subdirectories or a specific file.

get_file_path(subregion_name, osm_file_format)

Get the local path to an OSM data file of a geographic (sub)region.

get_pbf_layer_names(subregion_name[, data_dir])

Get indices and names of all layers in the PBF data file of a given (sub)region.

get_shp_pathname(subregion_name[, ...])

Get path(s) to shapefile(s) for a geographic (sub)region (by searching a local data directory).

make_shp_pkl_pathname(shp_zip_filename, ...)

Make a pathname of a pickle file for saving shapefile data.

merge_shp_layers(subregion_names, layer_name)

Merge shapefiles for a specific layer of two or multiple geographic regions.

read_csv_xz(subregion_name[, data_dir, ...])

Read a compressed CSV (.csv.xz) data file of a geographic (sub)region.

read_geojson_xz(subregion_name[, data_dir, ...])

Read a .geojson.xz data file of a geographic (sub)region.

read_gpkg(subregion_name[, layer_names, ...])

Reads GeoPackage (.gpkg.zip) data for a specific subregion.

read_pbf(subregion_name[, data_dir, ...])

Read a PBF (.osm.pbf) data file of a geographic (sub)region.

read_shp(subregion_name[, layer_names, ...])

Read a shapefile of a geographic (sub)region.

read_var_osm(meth, subregion_name, ...[, ...])

Read data file of various formats (other than PBF and shapefile) for a geographic (sub)region.

remove_extracts(path_to_extract_dir, verbose)

Remove data extracts.

validate_dtype(x)

Validate the data type of the input variable.

validate_file_path(path_to_file[, ...])

Validate the pathname of an OSM data file.

validate_shp_layer_names(layer_names_, ...)

Validate the input of layer name(s) for reading shapefiles.