Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gjoseph92/stackstac
Turn a STAC catalog into a dask-based xarray
https://github.com/gjoseph92/stackstac
cog dask geospatial rasterio stac xarray
Last synced: 17 days ago
JSON representation
Turn a STAC catalog into a dask-based xarray
- Host: GitHub
- URL: https://github.com/gjoseph92/stackstac
- Owner: gjoseph92
- License: mit
- Created: 2021-03-06T04:29:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-10T04:34:02.000Z (3 months ago)
- Last Synced: 2024-10-04T10:33:36.148Z (about 1 month ago)
- Topics: cog, dask, geospatial, rasterio, stac, xarray
- Language: Python
- Homepage: https://stackstac.readthedocs.io
- Size: 56.2 MB
- Stars: 242
- Watchers: 19
- Forks: 49
- Open Issues: 49
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-earthobservation-code - stackstac - Turn a list of STAC items into a 4D xarray DataArray `Python` (`Python` processing of optical imagery (non deep learning) / Cloud Native Geospatial)
README
# StackSTAC
[![Documentation Status](https://readthedocs.org/projects/stackstac/badge/?version=latest)](https://stackstac.readthedocs.io/en/latest/?badge=latest) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/gjoseph92/stackstac/main?labpath=%2Fdocs%2Fbasic.ipynb%3Ffile-browser-path%3D%2Fexamples)
Turn a list of [STAC](http://stacspec.org) items into a 4D [xarray](http://xarray.pydata.org/en/stable/) DataArray (dims: `time, band, y, x`), including reprojection to a common grid. The array is a lazy [Dask array](https://docs.dask.org/en/latest/array.html), so loading and processing the data in parallel—locally or [on a cluster](https://coiled.io/)—is just a `compute()` call away.
For more information and examples, please [see the documentation](https://stackstac.readthedocs.io).
```python
import stackstac
import pystac_clientURL = "https://earth-search.aws.element84.com/v1"
catalog = pystac_client.Client.open(URL)stac_items = catalog.search(
intersects=dict(type="Point", coordinates=[-105.78, 35.79]),
collections=["sentinel-2-l2a"],
datetime="2020-04-01/2020-05-01"
).get_all_items()stack = stackstac.stack(stac_items)
print(stack)
```
```dask.array
Coordinates: (12/24)
* time (time) datetime64[ns] 2020-04-01T18:04:04 ......
id (time)