Skip to content

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

@Jan-Hoc

Description

@Jan-Hoc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions