Skip to content

Commit

Permalink
FIX: Fixing Windows archived rasterio path (switching to vsizip/`vs…
Browse files Browse the repository at this point in the history
…itar` for all platform)
  • Loading branch information
remi-braun committed Jul 20, 2023
1 parent 243ddc5 commit d9a7bbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.28.3 (2023-07-20)

- FIX: Fixing Windows archived rasterio path (switching to `vsizip`/`vsitar` for all platform)

## 1.28.2 (2023-07-07)

- FIX: Allow collocating rasters (only if they are given as DataArrays) from different dtypes
Expand Down
6 changes: 5 additions & 1 deletion sertit/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ def get_archived_rio_path(
Returns:
Union[list, str]: Band path that can be read by rasterio
"""
archive_path = AnyPath(archive_path)
if archive_path.suffix in [".tar", ".zip"]:
prefix = archive_path.suffix[-3:]
elif archive_path.suffix == ".tar.gz":
Expand All @@ -442,8 +443,11 @@ def get_archived_rio_path(
f"{prefix}+file+{archive_path}!{path}" for path in archived_band_paths
]
else:
# archived_band_paths = [
# f"{prefix}+file://{archive_path}!{path}" for path in archived_band_paths
# ]
archived_band_paths = [
f"{prefix}+file://{archive_path}!{path}" for path in archived_band_paths
f"/vsi{prefix}/{archive_path}/{path}" for path in archived_band_paths
]

# Convert to str if needed
Expand Down

0 comments on commit d9a7bbe

Please sign in to comment.