Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Kerchunk indices embedded in STAC items #33

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dist
.direnv
.mypy_cache
.pytest_cache
.ruff_cache
.ruff_cache
*.egg-info/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ xr.open_dataset(asset)
```
ref: https://planetarycomputer.microsoft.com/docs/quickstarts/reading-zarr-data/


Here is an example using the new approach of storing kerchunked metadata within the data-cube extension:

```python
import pystac
import xarray as xr

path = "https://raw.githubusercontent.com/stac-utils/xpystac/main/tests/data/data-cube-kerchunk-item-collection.json"
item_collection = pystac.ItemCollection.from_file(path)

ds = xr.open_dataset(item_collection)
ds
```


## Install

```bash
Expand Down
3 changes: 2 additions & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: xpystac-broken
name: xpystac
channels:
- conda-forge
- nodefaults
Expand All @@ -11,6 +11,7 @@ dependencies:
- adlfs
- aiohttp
- fsspec
- kerchunk
- odc-stac
- planetary-computer
- pystac-client
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ def simple_zarr() -> pystac.Asset:
def complex_zarr(simple_zarr) -> pystac.Asset:
simple_zarr.extra_fields["xarray:open_kwargs"]["engine"] = "zarr"
return simple_zarr


@pytest.fixture(scope="module")
def data_cube_kerchunk() -> pystac.ItemCollection:
path = "tests/data/data-cube-kerchunk-item-collection.json"
return pystac.ItemCollection.from_file(path)
Loading