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: about 1 month 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: 2023-12-19T17:41:49.000Z (6 months ago)
- Last Synced: 2024-05-07T18:55:19.951Z (about 2 months ago)
- Topics: cog, dask, geospatial, rasterio, stac, xarray
- Language: Python
- Homepage: https://stackstac.readthedocs.io
- Size: 56.1 MB
- Stars: 224
- Watchers: 18
- Forks: 46
- Open Issues: 55
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Lists
- Awesome-Geospatial - stackstac - Turn a STAC catalog into a dask-based xarray. (Python)
- spyndex - stackstac
- awesome-earthobservation-code - stackstac - Turn a STAC catalog into a dask-based xarray `Python` (Other Datacube-related Python / Testing your code)
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)