Skip to content

Inability to load pixels near/at antimeridian #172

@alexgleith

Description

@alexgleith

We've been working to try to resolve issue with loading data at the antimeridian.

Currently, there seems to be an issue in both Datacube Core and ODC STAC when loading an antimeridian-touching geobox.

Below is some code that reproduces the issue.

from affine import Affine
from pystac import Item
from odc.geo.geobox import GeoBox
from odc.stac import load

affine = Affine(
    152.87405657034833,
    0.0,
    -20037508.342789244,
    0.0,
    -152.87405657034833,
    -1995923.6825825237,
)
geobox = GeoBox((256, 256), affine, "EPSG:3857")

item = Item.from_file("https://earth-search.aws.element84.com/v1/collections/sentinel-2-c1-l2a/items/S2A_T01KAA_20240825T221936_L2A")
data = load([item], geobox=geobox, measurements=["red", "green", "blue"], chunks={})

data.squeeze().to_array().plot.imshow()

The geobox looks fine, and is directly adjacent to the antimeridian.

image

The rendered data (white) should go all the way to the left edge of the frame in this image below.

image

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