Skip to content
Sam Doolin edited this page Feb 7, 2025 · 41 revisions

Welcome to the WorldPeatland Wiki!

If you've arrived here, it means you want to create BioGeoPhysical vegetation parameters for a peatland site. These parameters are one of the key component of the WorldPeatland Health Indicator.

Prerequisites

We assume that you are comfortable working in the Linux operating system and using the command line. We also assume some experience with git version control, the Python programming language, GeoJSON, GeoTIFF, and a familiarity with earth observation and data processing.

Before getting started you should make sure that you have:

  1. A virtual machine running on Creodias, to access the EODATA archive
    • anaconda or miniconda installed
  2. Earth Data account
    • Here is the link to create your Earth Data (LPDACC) account to be able to download MODIS data.
  3. Google Earth Engine account
    • you will need a google account associated with a google cloud project that has the Earth Engine API enabled. see this link for further information.

Steps to Get Started:

1. Create directories

for data and code as you see fit, e.g.

mkdir ~/data
mkdir ~/code

These directories are referred to as root data directory and code directory.

2. Clone repositories

cd ~/code
git clone [email protected]:Assimila/WorldPeatland.git
cd WorldPeatland
git checkout -b operation origin/operation
cd ..
git clone [email protected]:GerardoLopez/TATSSI.git
cd TATSSI
git checkout -b worldpeatland origin/tatssi_worldpeatland
cd ..

3. Set Up the Python Environment

cd ~/code
cd WorldPeatland
conda create --name worldpeatland --file worldpeatland-explicit-environment.txt
conda activate worldpeatland

4. Store your Earth Data credentials

Store your Earth Data username and password in a json file similar to the example below.

{
    "url": "https://e4ftl01.cr.usgs.gov/",
    "username": "<username>",
    "password": "<password>"
}

5. Save settings

Edit WorldPeatland/settings.py to specify paths to your root data directory and credentials.

  • Set ROOT_DATA_DIR to point to your root data directory.
  • Set EARTH_DATA_CRED to point to the file containing your Earth Data credentials.

6. configure google earth engine credentials

  • run earthengine authenticate and follow the prompts.
  • check the credential file has been created ~/.config/earthengine/credentials
  • run earthengine set_project <project_name>

7. Define sites

Create a geojson file to describe each site of interest. This defines the geospatial bounding box for data, site name, and country.

  • Use geojson.io to create a closed polygon (not lines) or a bounding box outlining your peatland site. You can do that by using the 'Draw Rectangular polygon (r)' from the tool bar on the left of the map. Now you have the coordinates of you bounding box.

  • To name the site, add a property site_area. Do not include any white spaces in the name of your site.

  • Add another property country, which is used to download VIIRS. The value of this property should follow the name nomenclature that VIIRS uses.

  • Save as a GeoJSON file.

For example:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "site_area": "Degero",
        "country": "Sweden"
      },
      "geometry": {
        "coordinates": [
          [
            [
              19.4425930710917,
              64.2372650939366
            ],
            [
              19.6938818612982,
              64.2355569375077
            ],
            [
              19.6956374665168,
              64.0871845721421
            ],
            [
              19.4433997005164,
              64.0867100842452
            ],
            [
              19.4425930710917,
              64.2372650939366
            ]
          ]
        ],
        "type": "Polygon"
      }
    }
  ]
}

8. Proceed to workflow

Proceed to workflow.