_Reader

class pydriosm.reader._Reader(max_tmpfile_size=None, data_dir=None, downloader=None, **kwargs)

Initialization of a data reader.

Parameters:
Variables:

downloader (GeofabrikDownloader or BBBikeDownloader or None) – instance of the class GeofabrikDownloader or BBBikeDownloader

Tests:

>>> from pydriosm.reader import _Reader

>>> r = _Reader()

>>> r.NAME
'OSM Reader'

>>> r.SHP
pydriosm.reader.SHPReadParse

Attributes

DEFAULT_DATA_DIR

str: Default data directory.

LONG_NAME

str: Full name of the data resource.

NAME

str: Name of the free download server.

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 path to an OSM data file (if available) of a specific file format for a geographic (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.

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

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

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

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

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

Read a .shp.zip data file of a geographic (sub)region.

remove_extracts(path_to_extract_dir, verbose)

Remove data extracts.

validate_file_path(path_to_osm_file[, ...])

Validate the pathname of an OSM data file.

validate_input_dtype(var_input)

Validate the data type of the input variable.

validate_shp_layer_names(layer_names_, ...)

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