Repository navigation
Stable Classes
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).
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
|
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.
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.