pyrosm.OSM.clear_downloads#
- static OSM.clear_downloads(filepath=None)#
Remove PBF files downloaded or cropped into the default download directory (
<tempdir>/pyrosm), with the partial files that interrupted downloads leave and the records kept beside crops. The result cache, the provider indexes and the bundled package datasets are left untouched.- Parameters:
filepath (str | os.PathLike (optional)) – A
.osm.pbfor.osh.pbffile to remove, with its partial files: a path removes exactly that file, a bare file name the file of that name in the download directory. WhenNone(default) every*.pbffile in the download directory is removed.- Returns:
The number of PBF and partial files removed.
- Return type:
int
- Raises:
ValueError – If
filepathdoes not name a.osm.pbfor.osh.pbffile.