Skip to content
João Siqueira edited this page Nov 10, 2026 · 5 revisions

The JavaScript scripts provided in this repository are specifically designed for use within the Google Earth Engine (GEE) Code Editor. To utilize these tools, simply copy the code from the desired .js file and paste it directly into the GEE web interface. These scripts leverage the MapBiomas API and Earth Engine's distributed computing power to perform advanced temporal analysis of Land Use and Land Cover (LULC) dynamics, allowing for seamless replication of the environmental metrics described in this documentation.

All scripts read the MapBiomas Brazil Collection 10.1 coverage asset, where each pixel holds one land cover class per year in bands classification_1985 to classification_2024. Analysis 10 compares two years; all the others reduce that 40-year series to a single value per pixel. The class of interest is set by targetClass at the top of each script (15, Pasture, by default). Pixels whose result is zero are masked with selfMask() and appear transparent on the map.

The figure of each analysis runs its script on the same four example pixels:

Four example pixels, 40 years each: A, a rotation of forest, pasture, mosaic and soybean that ends in pasture; B, forest in every year; C, pasture from 1991 to 2010, then forest again; D, forest until 2016, pasture in 2017–2018 and soybean from 2019

Analyses

  1. Class Age
  2. Class Frequency
  3. Number of Distinct Classes
  4. Number of Changes
  5. Stable Classes
  6. Class First Year
  7. Class Last Year
  8. Time Since Last Occurrence
  9. Accumulated Class
  10. Transitions

How to run a script

  1. Open the Google Earth Engine Code Editor (a GEE account is required).
  2. Copy the whole content of the script from codes/ into a new script.
  3. Adjust the parameters at the top (for example targetClass) and click Run. The result is added as a layer to the map.

The scripts load the official MapBiomas palettes with require('users/mapbiomas/modules:Palettes.js'), which is available to every GEE user.

See also: Figures, how the figures in this wiki are generated.

Clone this wiki locally