Skip to content

stackstac.stack returns empty array when items have different CRS #150

Closed
@xjtang

Description

@xjtang

I'm trying to stack all the Landsat 8 images for a site (-67.008753, -9.96445, -65.615556, -8.57408) on Planetary Computer. The site happens to be in between two Landsat paths. As a result, when I search the images in the Planetary Computer catalog, I get images in different UTM zones, about half the images in epsg:32720 and about half in epsg:32719. I just picked 32720 but then an empty was returned.

bbox = (-67.008753, -9.96445, -65.615556, -8.57408)

search = catalog.search(
    intersects=tile,
    datetime="2020-01-01/2020-12-31",
    collections=["landsat-8-c2-l2"],
    limit=1000,
    query={'landsat:collection_category': {'eq': 'T1'}}
)

signed_items = [planetary_computer.sign(item).to_dict() for item in items]

data = (
    stackstac.stack(
        signed_items,
        chunksize=4096,
        resolution=30,
        epsg=32720,
        bounds_latlon=bbox
    )
)

Array	Chunk

Bytes 0 B 0 B
Shape (0, 0, 5181, 5157) (0, 0, 4096, 4096)
Count 10 Tasks 4 Chunks
Type float64 numpy.ndarray

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