Unable to access specific file inside archive
According to the docs, in order for gdal to access a tif file within a tar or tgz, both path must be passed (the archive then the target file).
e.g. /vsitar/path/to/the/file.tar/path/inside/the/tar/file.tif
.
Since we currently check the extension of the file (at the end of the path), we'll fail to add the vsi prefix with this kind of input:
inp = pyotb.Input("archive.tgz/image.tif")
The problem is exactly the same for zip, 7z and rar.
Current implementation of add_vsi_prefix()
:
basename = filepath.split("?")[0]
ext = Path(basename).suffix
if ext in prefixes:
...
So this new feature is kind of broken right now (except for single file archives).
We need a regex match. Something like r"(.*?)(\.7z|\.zip|\.rar|\.tar\.gz|\.tgz|\.tar|\.gz)(.*)"
.
Edited by Vincent Delbar