_Reader
- class pydriosm.reader._Reader(max_tmpfile_size=None, data_dir=None, downloader=None, **kwargs)
Initialization of a data reader.
- Parameters:
max_tmpfile_size (int or None) – defaults to
None
, see also the function pyhelpers.settings.gdal_configurations()data_dir (str or None) – directory where the data file is located/saved, defaults to
None
; whendata_dir=None
, it refers to the directory specified by the corresponding downloaderdownloader (GeofabrikDownloader or BBBikeDownloader or None) – class of a downloader, valid options include
GeofabrikDownloader
andBBBikeDownloader
kwargs – [optional] parameters of the function pyhelpers.settings.gdal_configurations()
- Variables:
downloader (GeofabrikDownloader or BBBikeDownloader or None) – instance of the class
GeofabrikDownloader
orBBBikeDownloader
Tests:
>>> from pydriosm.reader import _Reader >>> r = _Reader() >>> r.NAME 'OSM Reader' >>> r.SHP pydriosm.reader.SHPReadParse
Attributes
str: Default data directory.
str: Full name of the data resource.
str: Name of the free download server.
Name or pathname of a data directory.
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.