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

Potential off-by-one-error when calculating x and y coordinates. #265

Open
Jan-Hoc opened this issue Jan 29, 2025 · 0 comments
Open

Potential off-by-one-error when calculating x and y coordinates. #265

Jan-Hoc opened this issue Jan 29, 2025 · 0 comments

Comments

@Jan-Hoc
Copy link

Jan-Hoc commented Jan 29, 2025

When reading an xarray file compared to the STAC item, the x-coordinates/longitude and y-coordinates/latitude diverge by one. Concretely, when reading the STAC Item, the last coordinate of the list is left out.
I suspect this comes from these two lines. Here, the upper coordinate of the bounding box is treated as an exclusive bound due to endpoint=False, however, in the STAC Item specification the bounds of the bbox attribute, which is used to extract the bounds, are inclusive.
This leads to inconsistencies in the x-/y-coordinates and longitude/latitude when reading from the STAC Item vs. directly reading the xarray file. I would propose setting endpoint=True to mitigate this issue unless I missed some deeper meaning in the upper bound being exclusive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant