2

I have many layers consist of many parameters. I want to create a new layer called 'Reforestation Priority Area' based on weighting given to existing layers. Is there any way to do that?

The code is below:

var countries = Indonesia

var Nama_Provinsi = ['Kalimantan Selatan'] 
var geometry = countries.filter(ee.Filter.inList('NAME_1', Nama_Provinsi));
var area1 = ee.FeatureCollection(geometry);

var image = ee.Image('WCMC/biomass_carbon_density/v1_0/2010');

Map.addLayer(
    image.clip(area1), {
      min: 1,
      max: 180,
      palette: ['d9f0a3', 'addd8e', '78c679', '41ab5d', '238443', '005a32']
    },
    'carbon_tonnes_per_ha');
    
var dataset = ee.Image('UMD/hansen/global_forest_change_2020_v1_8');
var treeCoverVisParam = {
  bands: ['treecover2000'],
  min: 0,
  max: 100,
  palette: ['black', 'green']
};
Map.addLayer(dataset.clip(area1), treeCoverVisParam, 'tree cover');

var treeLossVisParam = {
  bands: ['lossyear'],
  min: 0,
  max: 18,
  palette: ['yellow', 'red']
};
Map.addLayer(dataset.clip(area1), treeLossVisParam, 'tree loss year')

var dataset = ee.ImageCollection('MODIS/006/MOD13Q1')
                  .filter(ee.Filter.date('2020-01-01', '2020-12-31'));
var evi = dataset.select('EVI');
var eviVis = {
  min: 0.0,
  max: 8000.0,
  palette: [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
};
Map.setCenter(116, -3, 8);

var table_bound = function(image){
  return image.clip(area1);
};
var eviclipped = evi.map(table_bound)

Map.addLayer(eviclipped, eviVis, 'EVI2020');

var dataset = ee.Image("COPERNICUS/Landcover/100m/Proba-V-C3/Global/2019")
.select('discrete_classification');

Map.setCenter(116, -3, 8);

Map.addLayer(dataset.clip(area1), {}, "Land Cover");

//displaying the data in interactive map
Map.addLayer(image.clip(area1), {min:0, max: 300, 
palette: ['90EE90','FFFF00','FF0000']}, 'Raw SRTM'); //Light green, yellow, red

//display hillshading and slope
var hillshade = ee.Terrain.hillshade(image);
Map.addLayer(hillshade.clip(area1), {min:150, max:255,}, 'Hillshade', false);
print(hillshade);

var slope = ee.Terrain.slope(image);
Map.addLayer(slope.clip(area1), {min:0, max:20, pallete: ['FFFFFF']},'Slope', false);
print(slope);

1 Answer 1

1

If the weighting is linear against some thresholds, then you can probably do something like this:

// Binary thresholds
var result = ee.Image().int()
   .expression("term1 * 0.3 + term2 * 0.5 + term3 * 0.1", {
       term1: slope.lt(3),
       term2: evi.gt(0.6),
       term3: dataset.eq(10)
   })

If the terms are continuous instead, then just leave off the comparisons and multiply by whatever weighting factors directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.