Skip to content

Afforestation Tracker identifies and assesses optimal areas for tree planting in Africa's Sahel region to stop desertification.

License

Notifications You must be signed in to change notification settings

Luk-kar/Afforestation-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗺️🌴 Afforestation Tracker

📋 Overview

Sahara region

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:

  1. Areas good for planting trees
  2. Ground wetness
  3. Rainfall levels
  4. Soil carbon content
  5. Vegetation types
  6. Ground slope
  7. Height above sea level
  8. 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.

📊 Data Visualization

dashboard

Data used

  • 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

🗂️ Project Structure

data_pipeline

📚 Key Libraries

Data Acquisition:

  • ee:

    Tools for working with geographic data API on Google Earth Engine.

Data Visualization:

  • Streamlit:

    A tool for building web apps easily, transforming data scripts into interactive apps with little coding.

  • folium:

    Allows interactive maps in Python, using Leaflet.js for visualizing geographic data.

  • streamlit-folium:

    Enhances Streamlit apps with real-time map interactions

  • geemap:

    Adds more map controls and manages map layers efficiently in Google Earth Engine.

📦 Requirements

See the Pipfile for needed packages.

⚙️ Installation

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

🔧 Configuration

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

🌴 Afforestation Category Logic

Details in: app/stages/data_categorization.py.

🔨 Usage

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.

✅ Testing

To test, activate the environment and run tests:

pipenv shell
python -m unittest discover

💡 Notes

Insights include:

  1. 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.

  2. Backend Engine Alternatives: For apps needing heavy API use and detailed state management, try using Dash or Flask over Streamlit. Dash and Flask handle complex tasks better. See the differences here.

  3. Test Data Transformations Directly on Cloud Services: To streamline development, test data transformations directly on Google Earth Engine.

  4. Use Data Sources Independent of Cloud Providers: Use independent data sources like NASA, UCSB, iSDA, and ESA, 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 on AWS.

🧩 Ideas for Further Growth

  1. Show the user's current location.

  2. Map plant species to their optimal planting regions

    Click me

    Trees:

    Shrubs:

  3. Show suitable plant species for a selected point on the map.

📜 License

Licensed under the LICENSE file.

About

Afforestation Tracker identifies and assesses optimal areas for tree planting in Africa's Sahel region to stop desertification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published