remove_osm_file
- pydriosm.utils.remove_osm_file(path_to_file, verbose=True)[source]
Remove a downloaded OSM data file.
- Parameters:
path_to_file (str) – absolute path to a downloaded OSM data file
verbose (bool) – defaults to
True
Examples:
>>> from pydriosm.utils import remove_osm_file >>> from pyhelpers.dirs import cd >>> import os >>> path_to_pseudo_pbf_file = cd('tests\pseudo.osm.pbf') >>> try: ... open(path_to_pseudo_pbf_file, 'a').close() ... except OSError: ... print('Failed to create the file.') ... else: ... print('File created successfully.') File created successfully. >>> os.path.exists(path_to_pseudo_pbf_file) True >>> remove_osm_file(path_to_pseudo_pbf_file, verbose=True) Deleting "tests\pseudo.osm.pbf" ... Done. >>> os.path.exists(path_to_pseudo_pbf_file) False