BBBikeReader.validate_file_path¶
- classmethod BBBikeReader.validate_file_path(path_to_file, osm_filename=None, data_dir=None)[source]¶
Validate the pathname of an OSM data file.
- Parameters:
path_to_file (str | os.PathLike[str]) – pathname of an OSM data file
osm_filename (str) – filename of the OSM data file
data_dir (str | os.PathLike[str]) – name or pathname of the data directory
- Returns:
validated pathname of the specified OSM data file
- Return type:
str
Tests:
>>> from pydriosm.reader._base import BaseReader >>> import os >>> file_path = BaseReader.validate_file_path("a\b\c.osm.pbf") >>> file_path 'a\b\c.osm.pbf' >>> file_path = BaseReader.validate_file_path("a\b\c.osm.pbf", "x.y.z", data_dir="a\b") >>> os.path.relpath(file_path) 'a\b\x.y.z'