-
Notifications
You must be signed in to change notification settings - Fork 0
/
RADD_alerts_GEE
77 lines (71 loc) · 3.15 KB
/
RADD_alerts_GEE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var cafi = ee.FeatureCollection("projects/cafi_fao_congo/aoi/aoi_cafi"),
FNF2015 = ee.Image("projects/cafi_fao_congo/classification/FNF_2015"),
lsib = ee.FeatureCollection("projects/cafi_fao_congo/aoi/congo_basin_lsib");
/***** End of imports. If edited, may not auto-convert in the playground. *****/
//Accessing RADD forest disturbance alert (Reiche et al.,2021)
//Website: http://radd-alert.wur.nl
//Citation: Reiche et al. (2021): Forest disturbance alerts for the Congo Basin using Sentinel-1, ERL.
//add study area
Map.addLayer(lsib)
//---------------------------
//Access RADD image collection
//---------------------------
var radd = ee.ImageCollection('projects/radar-wur/raddalert/v1');
var geography = 'africa' // 'africa' (africa), 'asia' (asia & pacific)
var area = lsib.filter(ee.Filter.eq('CODE','COG'))
//print('RADD image collection:', radd);
//----------------------------------------
//Forest baseline
//----------------------------------------
var forest_baseline = FNF2015
Map.addLayer(forest_baseline, {palette:['black'], opacity: 0.3},'Forest baseline')
//-----------------
//Latest RADD alert
//-----------------
var latest_radd_alert = ee.Image(radd.filterMetadata('layer','contains','alert')
.filterMetadata('geography','contains',geography)
.sort('system:time_end', false).first());
print('Latest RADD alert '+ geography+':',latest_radd_alert)
//RADD alert: 2 = unconfirmed (low confidence) alert; 3 = confirmed (high confidence) alert
Map.addLayer(latest_radd_alert.select('Alert'), {min:2,max:3,palette:['blue','coral']}, 'RADD alert')
//RADD alert date: YYDOY (Year-Year-Day-Of-Year)
Map.addLayer(latest_radd_alert.select('Date'), {min:19000,max:24000, palette: ['ffffcc','800026']}, 'RADD alert date')
Map.setOptions('Satellite');
if (geography =='africa') {Map.setCenter(16,4,12)}
if (geography =='asia') {Map.setCenter(133.1,-3.2,12)}
var confirmed = latest_radd_alert.select('Alert').eq(3).clip(cafi).updateMask(FNF2015)
//chart annual changes in aoi
var raddyear = latest_radd_alert.select('Date').divide(1000).add(2000).updateMask(confirmed).toInt()
Map.addLayer(raddyear,{}, 'radd year')
print(raddyear,{min:2019, max:2023},'raddyear')
var raddarea = raddyear.multiply(ee.Image.pixelArea().divide(10000))
var raddcalc = raddarea.addBands(raddyear).reduceRegion({
reducer: ee.Reducer.sum().group({
groupField: 1
}),
geometry: area,
scale: 100,
maxPixels: 1e13
});
print(raddcalc)
var raddstatsFormatted = ee.List(raddcalc.get('groups'))
.map(function(el) {
var d = ee.Dictionary(el);
return [ee.Number(d.get('group')).format("%02d"), d.get('sum')];
});
var raddstatsDictionary = ee.Dictionary(raddstatsFormatted.flatten());
var raddchart = ui.Chart.array.values({
array: raddstatsDictionary.values(),
axis: 0,
xLabels: raddstatsDictionary.keys()
}).setChartType('ColumnChart')
.setOptions({
title: 'Yearly Disturbance ',
hAxis: {title: 'Year', format: '####'},
vAxis: {title: 'Area (m2)'},
legend: { position: "none" },
lineWidth: 1,
pointSize: 3
});
print(raddchart)