Skip to content

Commit 8f6df73

Browse files
committed
FIX: Don't fail when trying to load DEM bands if window=None
1 parent dda313b commit 8f6df73

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎CHANGES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- FIX: Better EPSG retrieval from `proj:epsg` (in addition to `proj:code`) from STAC properties, even if deprecated (see the warning [here](https://github.com/stac-extensions/projection/blob/a623c66acf5fc97bf93dd1cce7ef28ac74e8faeb/README.md?plain=1#L59))
77
- FIX: Handle Capella products with `.tiff` raster files (instead of `.tif`)
88
- FIX: Fix when trying to load a despeckle band when the speckle already exists (and is stored on the cloud)
9+
- FIX: Don't fail when trying to load DEM bands if `window=None`
910

1011
## 0.24.3 (2026-09-07)
1112

‎ci/weekly/test_all_sat_end_to_end_on_disk.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def _test_core(
249249
band_arr = prod.load( # noqa
250250
first_band,
251251
size=(stack.rio.width, stack.rio.height),
252+
window=None,
252253
clean_optical="clean",
253254
**kwargs,
254255
)[first_band]

‎eoreader/utils.py‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,18 +772,20 @@ def get_driver(kwargs: dict) -> str:
772772
def get_default_transform(path, **kwargs):
773773
"""Get data from rasterio dataset: transform, width, height, crs. Manages windows."""
774774
with rasterio.open(str(path)) as ds:
775-
if "window" in kwargs:
775+
if kwargs.get("window") is not None:
776776
from sertit import rasters_rio
777777

778778
rio_window = rasters_rio.get_window(ds, kwargs["window"])
779-
return (
780-
ds.window_transform(rio_window),
781-
rio_window.width,
782-
rio_window.height,
783-
ds.crs,
784-
)
785-
else:
786-
return ds.transform, ds.width, ds.height, ds.crs
779+
780+
if rio_window is not None:
781+
return (
782+
ds.window_transform(rio_window),
783+
rio_window.width,
784+
rio_window.height,
785+
ds.crs,
786+
)
787+
788+
return ds.transform, ds.width, ds.height, ds.crs
787789

788790

789791
def get_ext(file_path) -> str:

0 commit comments

Comments
 (0)