Skip to content

Commit 3ffd82a

Browse files
committed
Deprecate open_cog -- read_geotiff handles all sources
read_geotiff already accepts HTTP URLs, cloud URIs (s3://, gs://, az://), local files, and VRT files. open_cog is now a thin deprecated wrapper. Users just use read_geotiff for everything: read_geotiff('https://example.com/cog.tif') read_geotiff('s3://bucket/cog.tif') read_geotiff('/local/dem.tif') read_geotiff('mosaic.vrt') All with gpu=, chunks=, window=, band= options. Removed open_cog from the README feature matrix.
1 parent fd22dc9 commit 3ffd82a

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ Native GeoTIFF and Cloud Optimized GeoTIFF reader/writer. No GDAL required.
142142
| [read_geotiff](xrspatial/geotiff/__init__.py) | Read GeoTIFF / COG / VRT | ✅️ | ✅️ | ✅️ | ✅️ | ✅️ |
143143
| [write_geotiff](xrspatial/geotiff/__init__.py) | Write DataArray as GeoTIFF / COG | ✅️ | ✅️ | ✅️ | ✅️ | ✅️ |
144144
| [read_vrt / write_vrt](xrspatial/geotiff/__init__.py) | Virtual Raster Table mosaic | ✅️ | ✅️ | ✅️ | ✅️ | |
145-
| [open_cog](xrspatial/geotiff/__init__.py) | HTTP range-request COG reader | ✅️ | ✅️ | ✅️ | ✅️ | ✅️ |
146145

147146
`read_geotiff` and `write_geotiff` auto-dispatch to the correct backend:
148147

xrspatial/geotiff/__init__.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -443,32 +443,12 @@ def write_geotiff(data: xr.DataArray | np.ndarray, path: str, *,
443443
)
444444

445445

446-
def open_cog(url: str, *,
447-
overview_level: int | None = None,
448-
chunks: int | tuple | None = None,
449-
gpu: bool = False) -> xr.DataArray:
450-
"""Read a Cloud Optimized GeoTIFF from an HTTP URL.
451-
452-
Uses range requests so only the needed tiles are fetched.
453-
454-
Parameters
455-
----------
456-
url : str
457-
HTTP(S) URL to the COG.
458-
overview_level : int or None
459-
Overview level (0 = full resolution).
460-
chunks : int, tuple, or None
461-
Chunk size for Dask lazy reading.
462-
gpu : bool
463-
Use GPU-accelerated decompression.
446+
def open_cog(url: str, **kwargs) -> xr.DataArray:
447+
"""Deprecated: use ``read_geotiff(url, ...)`` instead.
464448
465-
Returns
466-
-------
467-
xr.DataArray
468-
NumPy, Dask, CuPy, or Dask+CuPy backed depending on options.
449+
read_geotiff handles HTTP URLs, cloud URIs, and local files.
469450
"""
470-
return read_geotiff(url, overview_level=overview_level,
471-
chunks=chunks, gpu=gpu)
451+
return read_geotiff(url, **kwargs)
472452

473453

474454
def read_geotiff_dask(source: str, *, chunks: int | tuple = 512,

0 commit comments

Comments
 (0)