# HG changeset patch
# User ecology
# Date 1729529230 0
# Node ID 828c02027180a1bbe059b26b0bb58285ee66e4b9
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/earth commit 4cbace8c3a71b7a1638cfd44a21f5d4b84d2fd15
diff -r 000000000000 -r 828c02027180 land_cover.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/land_cover.py Mon Oct 21 16:47:10 2024 +0000
@@ -0,0 +1,268 @@
+# Land Cover TE Algorithm Without GEE
+
+# How to Execute:
+# - Load the two images (.TIFF) of the rasters
+# to be processed in the "/data/land_cover/input" folder
+# - Setting the two filenames in the specific cell of this script (0)
+# - Run all cells of the script
+# - Check the script results in the "/data/land_cover/output" folder
+# - Land Cover Degradation "/data/land_cover/output/lc_dg.tiff"
+# - Land Cover Transition "/data/land_cover/output/lc_tr.tiff"
+
+# Librairies import
+import argparse
+import json
+import os
+import sys
+
+import matplotlib.pyplot as plt
+
+import numpy as np
+
+import rasterio
+from rasterio.plot import show
+
+from te_schemas.land_cover import LCLegendNesting
+from te_schemas.land_cover import LCTransitionDefinitionDeg
+
+# Methods to manage Rasters
+
+
+def remap(raster, problem_numbers, alternative_numbers):
+ n_min, n_max = raster.min(), raster.max()
+ replacer = np.arange(n_min, n_max + 1)
+ mask = (problem_numbers >= n_min) & (problem_numbers <= n_max)
+ replacer[problem_numbers[mask] - n_min] = alternative_numbers[mask]
+ raster_replaced = replacer[raster - n_min]
+ return raster_replaced
+
+
+def saveRaster(dataset, datasetPath, cols, rows, projection, namedataset=None):
+ if namedataset:
+ rasterSet = rasterio.open(datasetPath,
+ 'w',
+ driver='GTiff',
+ height=rows,
+ width=cols,
+ count=1,
+ dtype=np.int8,
+ crs=projection,
+ transform=transform, )
+ rasterSet.write(dataset, 1)
+ rasterSet.close()
+ else:
+ rasterSet = rasterio.open(datasetPath,
+ 'w',
+ driver='GTiff',
+ height=rows,
+ width=cols,
+ count=1,
+ dtype=np.int8,
+ crs=projection,
+ transform=transform, )
+ rasterSet.write(dataset, 1)
+ rasterSet.set_band_description(1, namedataset)
+ rasterSet.close()
+
+
+def plot(ndviImage, cmap):
+ src = rasterio.open(ndviImage, 'r')
+ fig, ax = plt.subplots(1, figsize=(12, 12))
+ show(src, cmap=cmap, ax=ax)
+ ax.set_xlabel('Est')
+ ax.set_ylabel('Nord')
+ plt.show()
+
+
+def plotContour(ndviImage, cmap):
+ src = rasterio.open(ndviImage, 'r')
+ fig, ax = plt.subplots(1, figsize=(12, 12))
+ show(src, cmap=cmap, contour=True, ax=ax)
+ ax.set_xlabel('Est')
+ ax.set_ylabel('Nord')
+ plt.show()
+
+
+# Setting inputs
+command_line_args = sys.argv[1:]
+
+
+parser = argparse.ArgumentParser(description="landcover inputs and outputs")
+# Add arguments
+parser.add_argument("--raster_1", help="raster 1")
+parser.add_argument("--raster_2", help="raster 2")
+parser.add_argument("--json", help="json")
+
+args = parser.parse_args(command_line_args)
+
+# Parse the command line arguments
+
+# Import data
+
+path_raster_yi = args.raster_1
+path_raster_yf = args.raster_2
+fjson = args.json
+# Input Rasters
+
+# Outputs
+out_dir = os.path.join(os.getcwd(), "data/land_cover/output/")
+if not os.path.exists(out_dir):
+ os.makedirs(out_dir)
+
+# Output Rasters
+path_lc_tr = os.path.join(out_dir, 'lc_tr.tiff')
+path_lc_bl = os.path.join(out_dir, 'lc_bl.tiff')
+path_lc_dg = os.path.join(out_dir, 'lc_dg.tiff')
+path_lc_tg = os.path.join(out_dir, 'lc_tg.tiff')
+path_change_yf_yi = os.path.join(out_dir, 'change_yf_yi.tiff')
+path_lc_baseline_esa = os.path.join(out_dir, 'lc_baseline_esa.tiff')
+path_lc_target_esa = os.path.join(out_dir, 'lc_target_esa.tiff')
+path_out_img = os.path.join(out_dir, 'stack.tiff')
+
+# Contours
+contours_change_yf_yi = os.path.join(out_dir, '/change_yf_yi0.shp')
+
+
+# Parsing Inputs
+# Load static inputs
+# Transition Matrix, ESA Legend, IPCC Legend
+# Input Raster and Vector Paths
+params = json.load(open(fjson))
+
+crs = params.get("crs")
+
+trans_matrix_val = params.get("trans_matrix")
+trans_matrix = LCTransitionDefinitionDeg.Schema().load(trans_matrix_val)
+
+esa_to_custom_nesting = LCLegendNesting.Schema().load(
+ params.get("legend_nesting_esa_to_custom")
+)
+
+ipcc_nesting = LCLegendNesting.Schema().load(
+ params.get("legend_nesting_custom_to_ipcc")
+)
+
+class_codes = sorted([c.code for c in esa_to_custom_nesting.parent.key])
+class_positions = [*range(1, len(class_codes) + 1)]
+
+# Load dynamic inputs
+# Baseline ESA Raster
+raster_yi = rasterio.open(path_raster_yi)
+lc_baseline_esa = raster_yi.read(1)
+yi_dict_profile = dict(raster_yi.profile)
+
+for k in yi_dict_profile:
+ print(k.upper(), yi_dict_profile[k])
+
+# Target ESA Raster
+raster_yf = rasterio.open(path_raster_yf)
+lc_target_esa = raster_yf.read(1)
+yf_dict_profile = dict(raster_yf.profile)
+
+for k in yf_dict_profile:
+ print(k.upper(), yf_dict_profile[k])
+
+cols = raster_yi.width
+rows = raster_yf.height
+transform = raster_yi.transform
+projection = raster_yi.crs
+
+# Setting up output
+saveRaster(lc_baseline_esa.astype('int8'),
+ path_lc_baseline_esa,
+ cols,
+ rows,
+ projection,
+ "Land_cover_yi")
+
+saveRaster(lc_target_esa.astype('int8'),
+ path_lc_target_esa,
+ cols,
+ rows,
+ projection,
+ "Land_cover_yf")
+
+# Algorithm execution
+# Transition codes are based on the class code indices
+# (i.e. their order when sorted by class code) -
+# not the class codes themselves.
+# So need to reclass the land cover used for the transition calculations
+# from the raw class codes to the positional indices of those class codes.
+# And before doing that, need to reclassified initial and
+# final layers to the IPCC (or custom) classes.
+
+# Processing baseline raster
+bl_remap_1 = remap(lc_baseline_esa,
+ np.asarray(esa_to_custom_nesting.get_list()[0]),
+ np.asarray(esa_to_custom_nesting.get_list()[1]))
+lc_bl = remap(bl_remap_1, np.asarray(class_codes), np.asarray(class_positions))
+
+saveRaster(lc_bl.astype('int8'),
+ path_lc_bl,
+ cols,
+ rows,
+ projection,
+ "Land_cover_yi")
+
+# Processing Target Raster
+tg_remap_1 = remap(lc_target_esa,
+ np.asarray(esa_to_custom_nesting.get_list()[0]),
+ np.asarray(esa_to_custom_nesting.get_list()[1]))
+lc_tg = remap(tg_remap_1, np.asarray(class_codes), np.asarray(class_positions))
+
+saveRaster(lc_tg.astype('int8'),
+ path_lc_tg,
+ cols,
+ rows,
+ projection,
+ "Land_cover_yf")
+
+# Processing Transition Map
+# Compute transition map (first digit for baseline land cover,
+# and second digit for target year land cover)
+lc_tr = (lc_bl * esa_to_custom_nesting.parent.get_multiplier()) + lc_tg
+
+# Compute land cover transition
+# Remap persistence classes so they are sequential.
+# This makes it easier to assign a clear color ramp in QGIS.
+lc_tr_pre_remap = remap(lc_tr,
+ np.asarray(trans_matrix.get_persistence_list()[0]),
+ np.asarray(trans_matrix.get_persistence_list()[1]))
+
+saveRaster(lc_tr_pre_remap.astype('int8'),
+ path_lc_tr,
+ cols,
+ rows,
+ projection,
+ "Land_cover_transitions_yi-yf")
+
+# Compute land cover degradation
+# definition of land cover transitions as degradation (-1),
+# improvement (1), or no relevant change (0)
+lc_dg = remap(lc_tr,
+ np.asarray(trans_matrix.get_list()[0]),
+ np.asarray(trans_matrix.get_list()[1]))
+
+saveRaster(lc_dg.astype('int8'),
+ path_lc_dg,
+ cols,
+ rows,
+ projection,
+ "Land_cover_degradation")
+
+# Compute Mutlibands stack
+# Land Cover Degradation + Baseline ESA
+# + Target ESA + Land Cover Transition
+dg_raster = rasterio.open(path_lc_dg, "r")
+dg = dg_raster.read(1, masked=True)
+baseline_esa = rasterio.open(path_lc_baseline_esa, "r").read(1, masked=True)
+target_esa = rasterio.open(path_lc_target_esa, "r").read(1, masked=True)
+tr = rasterio.open(path_lc_tr, "r").read(1, masked=True)
+
+band_list = [dg, lc_baseline_esa, lc_target_esa, tr]
+out_meta = dg_raster.meta.copy()
+out_meta.update({"count": 4})
+
+with rasterio.open(path_out_img, 'w', **out_meta) as dest:
+ for band_nr, src in enumerate(band_list, start=1):
+ dest.write(src, band_nr)
diff -r 000000000000 -r 828c02027180 landcover_subindic.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/landcover_subindic.xml Mon Oct 21 16:47:10 2024 +0000
@@ -0,0 +1,151 @@
+
+ subindicator to track land changes
+
+ 0.1.0
+ 0
+
+
+ numpy
+ matplotlib
+ rasterio
+ trends_earth_algorithms
+ trends_earth_schemas
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `. For more information follow the `Trends Earth doumentation`
+
+- json file containing the 7 land cover classes. We specify by default a json feel free to customize it according to your need.
+
+
+In the json config file you find defined a way to map ESA land cover classes into (the 7) IPCC land cover classes.
+As a user you can add a new set of rules to map land cover classes from any system (ESA, CLC, …) to the IPCC ones. In the end, the user can do three different things:
+
+ - Use the default set of mapping rules findable on this `github repository`
+ - Modify an existent set of mapping rules with custom associations
+ - Add a new set of rules, useful for any custom map depicting land cover
+
+See also custom `land cover classes`.
+
+**Output**
+- A potential Land degradation raster
+In the json config file there is also the definition of the transformation of the land use change into the three output classes (Degradation, Improvement, and Stable)
+
+For more information go on `the official trends earth documentation`
+
+ ]]>
+
+
+ @Manual{
+ title = {Trends.Earth. Conservation International},
+ year = {2022},
+ note = {http://trends.earth}
+ }
+
+
+
diff -r 000000000000 -r 828c02027180 test-data/EU_CLC_1990.tiff
Binary file test-data/EU_CLC_1990.tiff has changed
diff -r 000000000000 -r 828c02027180 test-data/EU_CLC_2018.tiff
Binary file test-data/EU_CLC_2018.tiff has changed
diff -r 000000000000 -r 828c02027180 test-data/change_yf_yi0.shp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/change_yf_yi0.shp Mon Oct 21 16:47:10 2024 +0000
@@ -0,0 +1,17 @@
+
Shapefile Galaxy Composite Dataset
+This composite dataset is composed of the following files:
diff -r 000000000000 -r 828c02027180 test-data/landcover.json
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/landcover.json Mon Oct 21 16:47:10 2024 +0000
@@ -0,0 +1,1446 @@
+{
+ "crosses_180th": false,
+ "crs": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]",
+ "legend_nesting_custom_to_ipcc": {
+ "child": {
+ "key": [
+ {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ }
+ ],
+ "name": "Custom Land Cover",
+ "nodata": {
+ "code": -32768,
+ "color": "#000000",
+ "description": null,
+ "name_long": "No data",
+ "name_short": "No data"
+ }
+ },
+ "nesting": {
+ "-32768": [
+ -32768
+ ],
+ "1": [
+ 1
+ ],
+ "2": [
+ 2
+ ],
+ "3": [
+ 3
+ ],
+ "4": [
+ 4
+ ],
+ "5": [
+ 5
+ ],
+ "6": [
+ 6
+ ],
+ "7": [
+ 7
+ ]
+ },
+ "parent": {
+ "key": [
+ {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ }
+ ],
+ "name": "UNCCD Land Cover",
+ "nodata": {
+ "code": -32768,
+ "color": "#000000",
+ "description": null,
+ "name_long": "No data",
+ "name_short": "No data"
+ }
+ }
+ },
+ "legend_nesting_esa_to_custom": {
+ "child": {
+ "key": [
+ {
+ "code": 10,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland, rainfed",
+ "name_short": null
+ },
+ {
+ "code": 11,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Herbaceous cover",
+ "name_short": null
+ },
+ {
+ "code": 12,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Tree or shrub cover",
+ "name_short": null
+ },
+ {
+ "code": 20,
+ "color": "#76F1EF",
+ "description": null,
+ "name_long": "Cropland, irrigated or post-flooding",
+ "name_short": null
+ },
+ {
+ "code": 30,
+ "color": "#DAEC6C",
+ "description": null,
+ "name_long": "Mosaic cropland (>50%) / natural vegetation (tree, shrub, herbaceous cover) (<50%)",
+ "name_short": null
+ },
+ {
+ "code": 40,
+ "color": "#CDC369",
+ "description": null,
+ "name_long": "Mosaic natural vegetation (tree, shrub, herbaceous cover) (>50%) / cropland (<50%)",
+ "name_short": null
+ },
+ {
+ "code": 50,
+ "color": "#006313",
+ "description": null,
+ "name_long": "Tree cover, broadleaved, evergreen, closed to open (>15%)",
+ "name_short": null
+ },
+ {
+ "code": 60,
+ "color": "#009E1D",
+ "description": null,
+ "name_long": "Tree cover, broadleaved, deciduous, closed to open (>15%)",
+ "name_short": null
+ },
+ {
+ "code": 61,
+ "color": "#009E1D",
+ "description": null,
+ "name_long": "Tree cover, broadleaved, deciduous, closed (>40%)",
+ "name_short": null
+ },
+ {
+ "code": 62,
+ "color": "#A3C329",
+ "description": null,
+ "name_long": "Tree cover, broadleaved, deciduous, open (15-40%)",
+ "name_short": null
+ },
+ {
+ "code": 70,
+ "color": "#003E0C",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, evergreen, closed to open (>15%)",
+ "name_short": null
+ },
+ {
+ "code": 71,
+ "color": "#003E0C",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, evergreen, closed (>40%)",
+ "name_short": null
+ },
+ {
+ "code": 72,
+ "color": "#00500F",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, evergreen, open (15-40%)",
+ "name_short": null
+ },
+ {
+ "code": 80,
+ "color": "#00500F",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, deciduous, closed to open (>15%)",
+ "name_short": null
+ },
+ {
+ "code": 81,
+ "color": "#00500F",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, deciduous, closed (>40%)",
+ "name_short": null
+ },
+ {
+ "code": 82,
+ "color": "#006313",
+ "description": null,
+ "name_long": "Tree cover, needleleaved, deciduous, open (15-40%)",
+ "name_short": null
+ },
+ {
+ "code": 90,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree cover, mixed leaf type (broadleaved and needleleaved)",
+ "name_short": null
+ },
+ {
+ "code": 100,
+ "color": "#8A9C21",
+ "description": null,
+ "name_long": "Mosaic tree and shrub (>50%) / herbaceous cover (<50%)",
+ "name_short": null
+ },
+ {
+ "code": 110,
+ "color": "#D09022",
+ "description": null,
+ "name_long": "Mosaic herbaceous cover (>50%) / tree and shrub (<50%)",
+ "name_short": null
+ },
+ {
+ "code": 120,
+ "color": "#A86019",
+ "description": null,
+ "name_long": "Shrubland",
+ "name_short": null
+ },
+ {
+ "code": 121,
+ "color": "#874913",
+ "description": null,
+ "name_long": "Shrubland evergreen",
+ "name_short": null
+ },
+ {
+ "code": 122,
+ "color": "#A86019",
+ "description": null,
+ "name_long": "Shrubland deciduous",
+ "name_short": null
+ },
+ {
+ "code": 130,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": null
+ },
+ {
+ "code": 140,
+ "color": "#FFD9D1",
+ "description": null,
+ "name_long": "Lichens and mosses",
+ "name_short": null
+ },
+ {
+ "code": 150,
+ "color": "#FFE7B0",
+ "description": null,
+ "name_long": "Sparse vegetation (tree, shrub, herbaceous cover) (<15%)",
+ "name_short": null
+ },
+ {
+ "code": 151,
+ "color": "#FFC16A",
+ "description": null,
+ "name_long": "Sparse trees (<15%)",
+ "name_short": null
+ },
+ {
+ "code": 152,
+ "color": "#FFCC7C",
+ "description": null,
+ "name_long": "Sparse shrub (<15%)",
+ "name_short": null
+ },
+ {
+ "code": 153,
+ "color": "#FFE7B0",
+ "description": null,
+ "name_long": "Sparse herbaceous cover (<15%)",
+ "name_short": null
+ },
+ {
+ "code": 160,
+ "color": "#00785B",
+ "description": null,
+ "name_long": "Tree cover, flooded, fresh or brakish water",
+ "name_short": null
+ },
+ {
+ "code": 170,
+ "color": "#009577",
+ "description": null,
+ "name_long": "Tree cover, flooded, saline water",
+ "name_short": null
+ },
+ {
+ "code": 180,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Shrub or herbaceous cover, flooded, fresh/saline/brakish water",
+ "name_short": null
+ },
+ {
+ "code": 190,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Urban areas",
+ "name_short": null
+ },
+ {
+ "code": 200,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Bare areas",
+ "name_short": null
+ },
+ {
+ "code": 201,
+ "color": "#DCDCDC",
+ "description": null,
+ "name_long": "Consolidated bare areas",
+ "name_short": null
+ },
+ {
+ "code": 202,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Unconsolidated bare areas",
+ "name_short": null
+ },
+ {
+ "code": 210,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water bodies",
+ "name_short": null
+ },
+ {
+ "code": 220,
+ "color": "#FFFFFF",
+ "description": null,
+ "name_long": "Permanent snow and ice",
+ "name_short": null
+ }
+ ],
+ "name": "ESA CCI Land Cover",
+ "nodata": {
+ "code": -32768,
+ "color": "#000000",
+ "description": null,
+ "name_long": "No data",
+ "name_short": "No data"
+ }
+ },
+ "nesting": {
+ "-32768": [
+ -32768
+ ],
+ "1": [
+ 50,
+ 60,
+ 61,
+ 62,
+ 70,
+ 71,
+ 72,
+ 80,
+ 81,
+ 82,
+ 90,
+ 100
+ ],
+ "2": [
+ 110,
+ 120,
+ 121,
+ 122,
+ 130,
+ 140,
+ 150,
+ 151,
+ 152,
+ 153
+ ],
+ "3": [
+ 10,
+ 11,
+ 12,
+ 20,
+ 30,
+ 40
+ ],
+ "4": [
+ 160,
+ 170,
+ 180
+ ],
+ "5": [
+ 190
+ ],
+ "6": [
+ 200,
+ 201,
+ 202,
+ 220
+ ],
+ "7": [
+ 210
+ ]
+ },
+ "parent": {
+ "key": [
+ {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ }
+ ],
+ "name": "Custom Land Cover",
+ "nodata": {
+ "code": -32768,
+ "color": "#000000",
+ "description": null,
+ "name_long": "No data",
+ "name_short": "No data"
+ }
+ }
+ },
+ "trans_matrix": {
+ "definitions": {
+ "name": "Degradation matrix",
+ "transitions": [
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "improvement"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "degradation"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ },
+ {
+ "final": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "initial": {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ },
+ "meaning": "stable"
+ }
+ ]
+ },
+ "legend": {
+ "key": [
+ {
+ "code": 1,
+ "color": "#787F1B",
+ "description": null,
+ "name_long": "Tree-covered",
+ "name_short": "Tree-covered"
+ },
+ {
+ "code": 2,
+ "color": "#FFAC42",
+ "description": null,
+ "name_long": "Grassland",
+ "name_short": "Grassland"
+ },
+ {
+ "code": 3,
+ "color": "#FFFB6E",
+ "description": null,
+ "name_long": "Cropland",
+ "name_short": "Cropland"
+ },
+ {
+ "code": 4,
+ "color": "#00DB84",
+ "description": null,
+ "name_long": "Wetland",
+ "name_short": "Wetland"
+ },
+ {
+ "code": 5,
+ "color": "#E60017",
+ "description": null,
+ "name_long": "Artificial",
+ "name_short": "Artificial"
+ },
+ {
+ "code": 6,
+ "color": "#FFF3D7",
+ "description": null,
+ "name_long": "Other land",
+ "name_short": "Bare land"
+ },
+ {
+ "code": 7,
+ "color": "#0053C4",
+ "description": null,
+ "name_long": "Water body",
+ "name_short": "Water body"
+ }
+ ],
+ "name": "Custom Land Cover",
+ "nodata": {
+ "code": -32768,
+ "color": "#000000",
+ "description": null,
+ "name_long": "No data",
+ "name_short": "No data"
+ }
+ },
+ "name": "Land cover transition definition matrix"
+ }
+}
\ No newline at end of file