download_or_copy#

download_or_copy(uri: str, target_dir: str, fs: rastervision.pipeline.file_system.file_system.FileSystem | None = None) str[source]#

Download or copy a file to a directory and return the local file path.

If the file already exists in target_dir, nothing is done. If the file is elsewhere but still local, it is copied to target_dir. If it is remote, it is downloaded to the cache dir and then moved to target_dir.

Parameters:
Returns:

Local path to file.

Return type:

str