opendatacube / odc-stac

Load STAC items into xarray Datasets.
Apache License 2.0
140 stars 20 forks source link

Anchor argument overridden in odc.stac.load #151

Open pjhartzell opened 7 months ago

pjhartzell commented 7 months ago

Problem

In odc-stac version 0.3.9, odc.stac.load is overriding an anchor argument value of AnchorEnum.CENTER with the AnchorEnum.EDGE value.

Minimal Example

This is illustrated in a Jupyter notebook accessing some simple STAC Items at https://github.com/pjhartzell/data-gap/blob/main/anchor.ipynb.

Potential solution

In looking through the output_geobox function, it looks like the incoming anchor argument is never used. Is it possible that L968 should be changed from:

anchor = _anchor

to something like this?

anchor = anchor if anchor else _anchor

Versions, hardware

odc-stac==0.3.9 odc-geo==0.4.3

Tested with Python 3.9 and 3.11.

Apple M1 (arm64)