-
Notifications
You must be signed in to change notification settings - Fork 25
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
Xarray attributes (CRS, transform) missing #91
Comments
@g2giovanni Currently intake-stac returns a standard xarray DataArray. Note that rioxarray is an extension of xarray, and the CRS is only added to the xarray object if you open a file via rioxarray or if you explicitly use the So before running methods like There is some discussion of using rioxarray behind the scenes in a future version of intake-stac (#75) |
@g2giovanni I'm also noticing you are using the 'sentinel-s2-l2a' collection rather than 'sentinel-s2-l2a-cogs' which is probably what you want since they are COGs rather than jpeg2k and not in a requester pays bucket Also, have a look at pystac-client which is replacing sat-search |
@matthewhanson seems that not all L2a data is available as COGs. I actually tried this when looking into the issue here: import intake
from pystac_client import Client # https://github.com/stac-utils/pystac-client
aoi = {'type': 'Polygon',
'coordinates': [[[9.59, 44.99],
[9.82, 44.99],
[9.82, 45.11],
[9.60, 45.11],
[9.59, 44.99]]]}
catalog = Client.open("https://earth-search.aws.element84.com/v0")
results = catalog.search(#collections=['sentinel-s2-l2a'], #2 found
collections=['sentinel-s2-l2a-cogs'], #0 found
intersects=aoi,
datetime='2018-01-01/2018-01-03',
)
print(f"{results.matched()} items found") |
Definitely some things missing here and there. |
@scottyhq you're right. It's the reason why I use the "sentinel-s2-l2a" for older years. |
@g2giovanni if there is a metadata issue with the sentinel-s2-l2a-cogs you can open an issue here describing in detail https://github.com/cirrus-geo/cirrus-earth-search |
I have issues opening some catalog on https://earth-search.aws.element84.com/v0.
When I try to make some operation with rioxarray (e.g., a clip operation) I get the error:
MissingCRS: CRS not found. Please set the CRS with 'rio.write_crs()'
That's because into the attributes of the xarray returned from the to_dask() method attributes transform, crs and res have not be set. I noticed this is happening only for catalogues of the beginning of 2018.
For this reason, rioxarry can't georeference data in the proper way.
Why those attributes have not been set?
A snippet of code to reproduce the error:
The clip operation with rioxarray is the one that fails (
asset_clipped = asset_xarray.rio.clip([mapping(_wkt_bounds)], crs=4326, all_touched=True, drop=True)
)The text was updated successfully, but these errors were encountered: