Geographic Information Systems Asked on June 11, 2021
I would like to calculate the loss area in a certain elevation class in GEE. When I run the code 1 below, it gives the same amount as the total loss area in my study region, code 2. I switched arealoss and class3 in code 1 as well, and didn’t work. How can I calculate the loss area in a certain elevation class?
code 1:
var arealoss= loss.multiply(ee.Image.pixelArea()).divide(10000);
var class3 = elevation.eq(3).selfMask();
var stats1 = arealoss.reduceRegion({ reducer:
ee.Reducer.sum(),
geometry: class3.geometry(),
scale: 30,
maxPixels: 1e9,
bestEffort: true });
code 2:
var stats2 = arealoss.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: peru.geometry(),
scale: 30,
maxPixels: 1e9,
bestEffort: true });
Besides, I want to repeat this calculation for 7 different elevation classes. is it possible to write a function for this calculation in GEE?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP