Skip to content

Carbon Emissions

View or edit on GitHub

This page is synchronized from trase/data/world/cdo/carbon_emissions/readme.md. Last modified on 2026-06-21 06:35 CEST by GitHub Actions. Please view or edit the original file there; changes should be reflected here after a midnight build (CET time), or manually triggering it with a GitHub action (link).

GHG Carbon Scripts (Google Earth Engine)

This repository provides a detailed guide and a suite of Google Earth Engine (GEE) JavaScript scripts designed to calculate commodity-driven deforestation and its associated greenhouse gas (GHG) emissions in Brazil. The methodology and calculations form a modular pipeline aligned with the Greenhouse Gas Protocol (GHGP) Tier 1 guidelines.


Overview

Land-use change—particularly deforestation driven by agricultural commodities—is a major contributor to global GHG emissions. This repository provides a structured approach to:

  • Identify commodity-driven deforestation
  • Quantify carbon stock changes
  • Estimate emissions from:
  • Above- and Below-Ground Biomass (ABG)
  • Mineral Soil Organic Carbon (SOC)
  • Peatland drainage and degradation

The system is built entirely in Google Earth Engine JavaScript, enabling large-scale geospatial analysis with cloud-based computation.


Methodology

The pipeline follows a GHG Protocol Tier 1 approach, meaning:

  • Uses default emission factors rather than site-specific measurements
  • Applies globally accepted datasets and coefficients
  • Prioritizes consistency and scalability over localized precision

Emission Components

Component Description
ABG Carbon Immediate emissions from vegetation loss
Mineral SOC Gradual emissions from soil carbon decay
Peat Emissions Long-term emissions from drained peatlands

Pipeline Architecture

The system is built on a modular architecture consisting of five main operational scripts, supported by a central core library. These scripts are designed to be run as standalone tools for specific analyses or combined into a single unified workflow (for instance, utilizing 2_export_statistics as the master execution script).

Commodity Conversion
↓
Emissions Calculation
├── ABG Emissions
├── Mineral SOC Emissions
└── Peat Emissions
↓
Aggregation by Territory & Export

Why modular?

  • Easier debugging and maintenance
  • Reusable across projects
  • Scalable to new geographies or datasets

Scripts Description

0_get_commodity_conversions.js

Goal: Detect and classify deforestation linked to specific commodities.

What it does: - Identifies land-use transitions (e.g., forest → pasture, forest → cropland) - Differentiates forest vs non-forest conversions - Supports multiple commodities (e.g., beef, soy)

Outputs: - Multi-band ImageCollection - Each band represents: - Commodity type - Year of conversion


1_get_abg_emissions.js

Goal: Estimate emissions from above- and below-ground biomass loss.

How it works: - Uses commodity conversion maps - Applies carbon stock values: - Natural vegetation - Commodity replacement land use

Key Concept:

Gross Emissions = Natural Carbon Stock in Deforested Areas
Net Emissions = Natural Carbon Stock − Replacement Carbon Stock

Outputs: - Annual emissions per pixel - Tagged by commodity and year


1_get_mineral_soc_emissions.js

Goal: Model soil carbon loss in mineral soils.

How it works: - Uses climate-specific SOC factors - Applies decay over time (typically 20 years) - Converts total SOC loss into annual emissions

Important: - Emissions are not instantaneous - Distributed over time using decay functions


1_get_peat_emissions.js

Goal: Estimate emissions from peatland drainage and disturbance.

How it works: - Filters deforestation areas using peatland maps - Applies constant emission factors per year - Models continuous emissions after disturbance

Key Insight: Peatlands emit carbon long after initial clearing


2_export_statistics.js

Goal: Aggregate and export final results.

Capabilities: - Converts pixel-level data into: - Total emissions - Total deforestation area - Aggregates by: - Administrative units (e.g., states) - Regions - Custom geometries

Output formats: - Tables (CSV) - Earth Engine exports


Core Module (module.js)

The shared backbone of the pipeline. Contains reusable functions for all scripts.


Key Functions

getCommodityDeforestation()

  • Identifies deforestation linked to specific commodities
  • Supports:
  • Forward-looking attribution
  • Backward-looking attribution

calculateAboveBelowgroundCarbonEmissions()

  • Computes:
  • Gross emissions (before land-use change)
  • Net emissions (after replacement)

getMineralSOCEmissions()

  • Estimates total SOC loss potential

annualizeMineralSOCEmissions()

  • Distributes SOC emissions across time (e.g., 20 years)

calculatePeatlandEmissions()

  • Iterates through deforestation years
  • Applies peat-specific emission factors annually

Data Flow

Input Data
├── Land cover maps
├── Carbon stock datasets
├── Climate zones
├── Peatland extent
↓
Commodity Conversion Detection
↓
Emission Calculations (3 modules)
↓
Aggregation & Export
↓
Final GHG Reporting Outputs

Example Workflow

var utils = require('users/trasegis/tools:ghg_conversion_calculator/modules')

var lulcConversions = require('users/trasegis/tools:ghg_conversion_calculator/0_get_commodity_deforestation')

// ===========================================================================================================
// Asset Session

var assetTerritory = 'projects/trase/STORAGE/BR/BOUNDARIES/BIOMES/br_biomes_2019'

var assetPeatlands = 'projects/trase-396112/assets/brazil/thematics/peatlands'

// ===========================================================================================================
// Config Session

// This is fixed, no need to change
var ipccFactors = {
    peatlands: {
        tropical_areas: 55.8,//  55.8 t CO2-eq/ha/year (Wetlands 2013)
        temperate_areas: 40.1
    }
}

// ===========================================================================================================
// Input Data

var territoryFeatureCollection = ee.FeatureCollection(assetTerritory)

var peatlands = ee.ImageCollection(assetPeatlands)
    .filter(ee.Filter.eq('version', 'v1'))
    .mosaic()

// ===========================================================================================================
// Get Emissions

var commodityDeforestationCollection = lulcConversions.commodityDeforestation

var peatlandEmission = utils.calculatePeatlandEmissions(
    commodityDeforestationCollection, // ee.ImageCollection, each image correspond to one year
    peatlands, // ee.Image of the peatland map,
    ipccFactors.peatlands.tropical_areas
)

print('Peat Emissions', peatlandEmission)

exports.peatlandEmission = peatlandEmission