gjoseph92 / stackstac

Turn a STAC catalog into a dask-based xarray
https://stackstac.readthedocs.io
MIT License
232 stars 49 forks source link

Handle empty input better #248

Open gjoseph92 opened 1 month ago

gjoseph92 commented 1 month ago

When passing an empty list of items, things can fail in various ways. Making this work correctly can be handy if you're looping over a bunch of AOIs; sometimes, there might be no data there, but it would be nice to not have to add conditionals to handle this.

The trickiest part will be when bands aren't passed explicitly (almost always). We probably have to error in that case. Even if item_assets were defined, we'd still not have access to the parent Collection object without fetching it (which we are loathe to do; no network reqs should happen during stacking, though maybe that rule is worth giving up for this?).