# STAC -\> Xarray Loading Best Practices

**URL:** <https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062>\
**Category:** Data\
**Created:** [February 28, 2024, 1:57pm UTC](https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062 "2024-02-28T13:57:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![forrestfwilliams](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/forrestfwilliams/32/1651_2.png) [@forrestfwilliams](https://discourse.pangeo.io/u/forrestfwilliams)\
**Post date:** [February 28, 2024, 1:57pm UTC](https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062/1 "2024-02-28T13:57:32Z")

</div>

Hi All! I’m in the process of creating a workflow that loads representations of data stacks from a set of STAC items into an Xarray dataset. I see that both the [`stackstac`](https://stackstac.readthedocs.io/en/latest/) and [`odc-stac`](https://odc-stac.readthedocs.io/en/latest/) python packages are used by members of the community to perform this task.

Do you all have any thoughts on the advantages/disadvantages of these packages, and on which I should use? Thanks!

---

<div class="post-metadata">

**Author:** ![TomAugspurger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/tomaugspurger/32/21_2.png) [@TomAugspurger](https://discourse.pangeo.io/u/TomAugspurger)\
**Post date:** [February 28, 2024, 2:48pm UTC](https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062/2 "2024-02-28T14:48:52Z")

</div>

There’s some discussion at [https://github.com/opendatacube/odc-stac/issues/54](https://github.com/opendatacube/odc-stac/issues/54) (thought parts will be outdated now).

---

<div class="post-metadata">

**Author:** ![forrestfwilliams](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/forrestfwilliams/32/1651_2.png) [@forrestfwilliams](https://discourse.pangeo.io/u/forrestfwilliams)\
**Post date:** [February 28, 2024, 3:08pm UTC](https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062/3 "2024-02-28T15:08:24Z")

</div>

Thanks @TomAugspurger this is really helpful! Sounds like `stackstac` has some useful features that `odc-stac` hasn’t adopted yet (namely STAC item property loading). However there’s no guarantee of long-term support of `stackstac` so it may be safer to use `odc-stac` for long-lived projects.

---

<div class="post-metadata">

**Author:** ![kirill.kzb](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/kirill.kzb/32/1276_2.png) [@kirill.kzb](https://discourse.pangeo.io/u/kirill.kzb)\
**Post date:** [March 13, 2024, 10:30am UTC](https://discourse.pangeo.io/t/stac-xarray-loading-best-practices/4062/4 "2024-03-13T10:30:54Z")

</div>

> that `odc-stac` hasn’t adopted yet (namely STAC item property loading).

This is somewhat more complicated to achieve in `odc-stac`, that’s because we potentially combine multiple items into the same raster, and so you end up with fewer elements for dimension 0 than the number of items supplied. But we should support that feature when no item grouping is done, and even for grouped case we can expose stac properties via extra variable, something like `.stac_metadata`.
