Skip to content

Commit f9f94cf

Browse files
committed
FIX: Better SNAP geo_region name to disambiguate between products
1 parent f71edb5 commit f9f94cf

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.24.1 (2026-mm-dd)
44

5+
- FIX: Better SNAP geo_region name to disambiguate between products
56
- FIX: Fix subsetting complex SAR data with a window (cannot be done directly in the ESA SNAP Read Operator)
67
- FIX: Fix `KeyError` when loading a Landsat Collection-2 band from a STAC item whose asset name differs from the STAC common name (e.g. `nir08` instead of `nir`) [#307](https://github.com/sertit/eoreader/issues/307)
78

eoreader/products/sar/sar_product.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,11 +951,18 @@ def _get_subset(self, tmp_dir, **kwargs) -> (str, str):
951951
try:
952952
# geo_region = window
953953
# Take a buffer to prevent border effects from terrain correction
954-
geo_region = os.path.join(self.output, "geo_region.shp")
955-
geo_region_gdf = geometry.buffer(
956-
geo_region_gdf.to_crs(self.crs()), 1000, resolution=2
954+
win_suffix = utils.get_window_suffix(window)
955+
if win_suffix:
956+
win_suffix = f"_{win_suffix}"
957+
958+
geo_region, exists = self._get_out_path(
959+
f"{self.condensed_name}{win_suffix}_snap_geo_region.shp"
957960
)
958-
geo_region_gdf.to_crs(WGS84).to_file(geo_region)
961+
if not exists:
962+
geo_region_gdf = geometry.buffer(
963+
geo_region_gdf.to_crs(self.crs()), 1000, resolution=2
964+
)
965+
vectors.write(geo_region_gdf.to_crs(WGS84), path=geo_region)
959966
except Exception as exc:
960967
raise NotImplementedError(
961968
"Window should either be a GeoDataFrame, readable as a vector or set to None. Bounds, tuple, list and 'rasterio.Window' are not supported."

0 commit comments

Comments
 (0)