This project demonstrates how to work with STAC (SpatioTemporal Asset Catalog) data by retrieving crop type maps from the ThEO STAC API, processing the data, and generating an animated GIF. The project uses Python along with libraries such as pystac_client, stackstac, and geogif.
This repository is aimed at demonstrating how to work with remote sensing data using the ThEO STAC API. The primary goal is to show how spatial data can be accessed, processed, and visualized effectively. In particular, the script located in src/stac_demo.py retrieves crop type maps from the ThEO STAC API for a defined geographic area and time range, stacks the data into a mosaic using stackstac, and generates an animated GIF using geogif. This visual representation helps illustrate temporal variations in crop types.
The script located in src/stac_demo.py connects to a STAC API, stacks and processes the resulting data, and eventually produces an animated GIF stored in the output directory.
An environment.yml file is provided to help you create the necessary environment with all required dependencies. You can create the environment using either Conda or Micromamba.
-
Make sure you have Conda installed.
-
Create the environment by running:
conda env create -f environment.yml
-
Activate the environment:
conda activate theo-stac-demo
-
Ensure you have Micromamba installed.
-
Create the environment by running:
micromamba create --file environment.yml
-
Activate the environment:
micromamba activate theo-stac-demo
After activating the environment, you can run the source code using the following command:
python src/stac_demo.pyThe script will connect to the STAC API, process the crop type data, and generate an animated GIF saved in the output folder.
For interactive exploration, you can use the provided Jupyter notebook src/stac_demo_notebook.ipynb. This notebook allows you to step through the workflow, experiment with parameters, and visualize results interactively as an alternative to running the Python script.
This project is licensed under the terms specified in the LICENSE file.
