Skip to content

Stable Classes

João Siqueira edited this page Nov 10, 2026 · 2 revisions

Script: codes/analysis_5_stable.js. The calculation is in the function getStableClasses.

Description: Keeps only the pixels that had the same class in every year from 1985 to 2024, with that class as their value; every other pixel is masked.

What it shows: These are the "remnants" or "climax" areas: primary forests or long-term consolidated land uses that never changed. A single year in another class is enough to remove a pixel: in the example, pixel D was forest for 32 years but is not stable because of two pasture years. Only pixel B is stable, with class 3 (Forest Formation).

Stable classes on the four example pixels: only B, with class 3

Parameters

Set at the top of the script; change them before running.

variable default meaning
asset Collection 10.1 coverage asset the multi-band image read by the script
years 1985 … 2024 years included in the series
bandPrefix 'classification_' band names are bandPrefix + year

Map layers

Besides a land cover reference layer (hidden by default), the script adds:

layer value colors
Stable Classes land cover class MapBiomas legend colors

Pixels with no result are masked and appear transparent.

How to run

Copy the whole script into the Google Earth Engine Code Editor, adjust the parameters and click Run. See Home for the example pixels used in the figure.


← 4. Number of Changes · Home · 6. Class First Year →

Clone this wiki locally