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

STAC resolution issues with 3dep-seamless data #277

Open
mehran66 opened this issue Oct 5, 2023 · 1 comment
Open

STAC resolution issues with 3dep-seamless data #277

mehran66 opened this issue Oct 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mehran66
Copy link

mehran66 commented Oct 5, 2023

I have been getting errors with a lot of locations for getting 10m 3dep-seamless data. For example, if you run the following code, you get a 0B array with the size of time: 0 band: 0 y: 17420 x: 20754. But when downloading the asset, all look good in QGIS.

bbox = (-111.53704394307145, 33.254325353655645, -111.32951420183198, 33.42851341810459)
catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)
search = catalog.search(
    collections="3dep-seamless", 
    bbox=bbox, 
    query={"gsd": {"eq": 10}}
)
items = search.item_collection()

dem_raster_all = stackstac.stack(items, 
                                 bounds_latlon=bbox,
                                 chunksize=512,
                                 resampling=rasterio.enums.Resampling.bilinear,
                                ).squeeze()
dem_raster_all

I started to compare the STAC item of successful locations with the ones failing .... I found that the only difference is the resolutions...the ones succeed has a resolution of (9.2592593e-05, -9.2592593e-05) and the ones failing have a resolution of (1e-05, -1e-05). I also downloaded the asset and check out in QGIS and found the (9.2592593e-05, -9.2592593e-05) resolution is the correct one. For now, I manually change the STAC item to fix this issue:

items[0].properties['proj:transform'][0] =9.2592593e-05
items[0].properties['proj:transform'][4] =-9.2592593e-05

@TomAugspurger
Copy link

Thanks for the report. This looks a lot like stactools-packages/threedep#9.

I believe that was fixed in the stactools package, but it seems that we haven't yet regenerated the STAC items. We'll add that to our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants