I need to run a Propensity Score Analysis with forest loss in a given region between 2017 to 2020. I am new to GEE, and I can't seem to find out how to retrieve total loss from 2017-2020 for the ROI. Ultimately I need deforested area per pixel. I am using ArcGIS for data processing after exporting data from GEE. I tried this:
// Select lossyear band from Hansen and the total ROI var hansen = hansen.select(['lossyear']).clip(intersection) // Select relevant years and add them up into one image var loss2017 = hansen.eq(17) var loss2018 = hansen.eq(18) var loss2019 = hansen.eq(19) var loss2020 = hansen.eq(20) var allyears = loss2017.add(loss2018).add(loss2019).add(loss2020);
But it didn't seem right when I mapped it. I had used also
var lossImage = hansen.select(['loss']); var lossAreaImage = lossImage.multiply(ee.Image.pixelArea());
in an attempt to export deforested pixels 2000-2020, but I ended up with total areas for every pixel, which I couldn't use.
How can I do this?