This project is inspired by the UN's Great Green Wall initiative in Africa.
The Afforestation Tracker is an online tool that tracks and studies areas in the Sahel region for planting trees. It uses geographic data from different sources to assess the environment and find the best locations for planting.
The system features an interactive map that allows users to explore different layers like:
- Areas good for planting trees
- Ground wetness
- Rainfall levels
- Soil carbon content
- Vegetation types
- Ground slope
- Height above sea level
- Satellite photos
Each type of data comes with a guide to help users understand it. By clicking on a map point, users can see detailed info about that place's tree-planting potential.
The system gathers data from Google Earth Engine
for environmental info and Nominatim
for place names. It uses Streamlit
for the web interface, with folium
and geemap
for maps, making it easy to use online.
This tool is useful for researchers and decision-makers involved in tree planting in the Sahel to help with managing land sustainably.
-
Rootzone Soil Moisture:
Sourced from NASA's SMAP Mission, specifically the SPL4SMGP dataset, which offers high-resolution soil moisture data essential for assessing suitable planting sites, when precipitation is low, but there are floods. Details
-
Precipitation:
Daily precipitation data is provided by the UCSB Climate Hazards Group InfraRed Precipitation with Station data (CHIRPS), which helps in understanding rainfall patterns critical for vegetation. Details
-
Elevation:
Elevation data is obtained from the USGS SRTMGL1 dataset, aiding in the evaluation of plant species requirements and terrain accessibility. Details
-
Soil Organic Carbon:
The ISDASOIL database provides data on soil organic carbon content across Africa, crucial for assessing soil health and fertility. Details
-
World Type Terrain Cover:
Utilizes the ESA WorldCover dataset to map different types of terrain cover, which supports the selection of appropriate vegetation types for different areas. Details
-
Satellite Imagery:
High-resolution imagery from the Copernicus Sentinel-2 mission is employed to obtain current and accurate visualizations of the landscapes, enhancing the precision of assessments. Details
-
Place Names:
The Nominatim API is utilized to retrieve accurate place names, improving the mapping interface's usability by enabling easy search and location identification for specific areas. Details
Data Acquisition:
-
Tools for working with geographic data API on Google Earth Engine.
Data Visualization:
-
A tool for building web apps easily, transforming data scripts into interactive apps with little coding.
-
Allows interactive maps in Python, using Leaflet.js for visualizing geographic data.
-
Enhances Streamlit apps with real-time map interactions
-
Adds more map controls and manages map layers efficiently in Google Earth Engine.
See the Pipfile
for needed packages.
Before you launch the app, prepare the .env
file with these settings:
YOUR_ACCESS_TOKEN: The full path to your GEE service account JSON key file.
SERVICE_ACCOUNT: The email address of your GEE service account.
To prepare the environment:
pip install pipenv
pipenv install
pipenv shell
Adjust settings in the app/config.py file, which controls configurations and outlines data processing steps.
Details include:
- UI settings
- Data sample size for Google Earth Engine
- Target region and data collection settings
- Sources and visualization settings for different data types
Details in: app/stages/data_categorization.py
.
Run the app with:
streamlit run app/streamlit_app.py
🚨 Note:
Depends on external data, so loading times may vary. Refresh the app if some elements fail to load. Keep your GEE
private key updated.
To test, activate the environment and run tests:
pipenv shell
python -m unittest discover
Insights include:
-
State management and caching:
in
Streamlit v1.37.1
is often unstable, making it hard to update UI elements consistently, especially with the external server's API calls. Bugs can occur silently, especially when UI or dynamic JavaScript elements don't show up. It's best to use these features sparingly. -
Backend Engine Alternatives: For apps needing heavy API use and detailed state management, try using Dash or Flask over Streamlit.
Dash
andFlask
handle complex tasks better. See the differences here. -
Test Data Transformations Directly on Cloud Services: To streamline development, test data transformations directly on
Google Earth Engine
. -
Use Data Sources Independent of Cloud Providers: Use independent data sources like
NASA
,UCSB
,iSDA
, andESA
, available freely or by subscription. This lessens reliance on the Google Cloud Platform (GCP
) and keeps data accessible if it goes down. Some data can be also found onAWS
.
-
Show the user's current location.
-
Map plant species to their optimal planting regions
Click me
- Acacia senegal (Gum Arabic Tree)
- Faidherbia albida (Apple-ring Acacia)
- Balanites aegyptiaca (Desert Date)
- Parkia biglobosa (African Locust Bean Tree)
- Adansonia digitata (Baobab)
- Ziziphus mauritiana (Jujube)
- Guiera senegalensis (Guiera)
- Piliostigma reticulatum (Camel’s Foot)
- Combretum micranthum (Kinkeliba)
- Leptadenia pyrotechnica (Marakh)
-
Show suitable plant species for a selected point on the map.
Licensed under the LICENSE file.