cog3pio
cog3pio copied to clipboard
:sparkles: Implement cog3pio xarray BackendEntrypoint
Allow 'cog3pio' to be used as an engine in xarray.open_dataarray
and xarray.open_dataset
!
Usage (Python):
import xarray as xr
with xr.open_dataarray(
filename_or_obj="https://github.com/cogeotiff/rio-tiler/raw/6.4.1/tests/fixtures/cog_nodata_nan.tif",
engine="cog3pio",
) as da:
assert da.sizes == {'band': 1, 'y': 549, 'x': 549}
assert da.dtype == "float32"
TODO:
- [x] Initial implementation of xarray BackendEntrypoint
- [x] Decode xy coordinates, depend on changes at https://github.com/georust/geo/pull/1159
- [x] Benchmark
cog3pio
engine vsrioxarray
engine - [ ] Document example usage in main README.md and docstrings
- [ ] etc
TODO in the future:
- [ ] Handle NaN values in GeoTIFF properly
References:
- https://docs.xarray.dev/en/v2024.02.0/internals/how-to-add-new-backend.html