This repository provides a workflow for analyzing the impact of urban trees on local climate regulation. This workflow is an adapted version of the methodolgy described in Venter et al. (2020).
Code is provided for the following tasks:
-
Extract Raster Data
extract_raster_data.js
- extract raster data from GEE
-
Raster Processing
- kedro pipeline:
raster_processing
- load single GeoTIFFs into a rasterstack
- convert a raster stack to a GeoDataFrame, where each band becomes a colum, and each pixel value is a row.
- kedro pipeline:
-
Land Surface Temperature (LST) counterfactual modelling
- kedro pipeline:
lst_counterfactual
- calculate the LST counterfactual for each pixel in the study area
- kedro pipeline:
-
Ecosystem service calculation
- kedro pipeline:
ecosystem_services
- calculate the ecosystem services per district
- kedro pipeline:
Complete documentation is hosted on GitHub Pages: Urban Climate Documentation
This project utilizes the Kedro Framework to streamline data processing and analysis. See the documentation for detailed step by step instricutions on how to set up the project and run the project.
-
Environment set up
Docker
The project uses gdal, which can be hard to install. A Dockerfile is provided that uses a gdal image, so that he project can be run in a container. Documentation on how to build and run the Docker image for this project can be found here.
# Build container from Dockerfile docker build -t <image-name>:<image-tag> .
Note that the containter contains no data, so please ensure to mount your data into the container (see
template_devcontainer.json
).
Virtual Environement (.venv)
If you have gdal bindings installed on your pc, you can also run the project in a virtual environment. A virtual environment can be set up using the following commands:
# Create a virtual environment python3 -m venv .venv # Activate the virtual environment source .venv/bin/activate # Install the requirements pip install -r requirements.txt
-
Kedro | run the pipelines
The project contains three Kedro pipelines:
- raster_processing: loads and processes the input data
- lst_counterfactual: runs the LST counterfactual modelling
- ecosystem_services: calculates the ecosystem services
The pipelines can be run using the following commands:
# Enter the container docker run -v /host/directory:/container/directory:cached <image-id> kedro run --pipeline=<pipeline-name>
# Kedro commands kedro run --pipeline=raster_processing kedro run --pipeline=lst_counterfactual kedro run --pipeline=ecosystem_services
The pipelines can also be run in sequence using the following command:
kedro run
-
** Kedro | visualize the workflow**
The workflow can be visualized using the Kedro Viz tool. This tool can be accessed by running
kedro viz
in the terminal.
- Venter, Z.S., et al. (2020) Linking green infrastructure to urban heat and human health risk mitigation in Oslo, Norway. Science of The Total Environment, 709, 136193. https://doi.org/10.1016/j.scitotenv.2019.136193
-
Willeke A'Campo (NINA), willeke.acampo@nina.no
-
Zander Venter (NINA), zander.venter@nina.no
This repository is part of the project:
TREKRONER Prosjektet | Trærs betydning for klimatilpasning, karbonbinding, økosystemtjenester og biologisk mangfold.