Skip to content

Should xpystac attempt to stack? #47

@jsignell

Description

@jsignell

The more I have been thinking about this library the more I am wondering if it is maybe too many layers of indirection.

I do think there is value in making it easier to open assets.

Compare:

without xpystac

import xarray as xr

xr.open_zarr(
    asset.href,
    **asset.extra_fields["xarray:open_kwargs"],
    storage_options=asset.extra_fields["xarray:storage_options"]
)

with xpystac

import xarray as xr

xr.open_dataset(asset)

But I am less confident about the stacking. There is just so much going on in odc-stac and stackstac and all that needs to be configured carefully. I'm wondering if it might make more sense to return an iterable of datasets or a xr.DataTree if the input is a collection or an item collection and leave it to the user to figure out how they want to stack things....

For an item containing assets where each asset is a single-band COG I think open_mfdataset makes a lot of sense, but then you'd have to use that internally since the input wouldn't strictly be a list. So at that point you are kind of just writing another version of a stacking library...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions