-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathburn-removal.js
More file actions
85 lines (67 loc) · 3.79 KB
/
burn-removal.js
File metadata and controls
85 lines (67 loc) · 3.79 KB
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
78
79
80
81
82
83
84
85
/// Creating a Feature Collection to use for the Removal of Burn Scars from Imagery //////
////////////// CODE WRITTEN/COMPILED BY joshua.himmelstein@gmail.com ////////////////
////////////// BEGIN MASKING OUT FLOODPLAIN //////////////
// Location to help locate correct image, in this case center of Lagoa Kuhikugu near Xingu River
Map.addLayer(LagoaKuhikugu,{},'LagoaKuhikugu') // Add point to the map
// Use watershed layer made from DEM in ArcGIS to exclude elevations in floodplain
var xingu_floodplain = Mask_floodplain.clip(Xingu_indig_area)
var fp1 = xingu_floodplain.eq(1) //define threshold, if value equal to 0, return those pixels
var fp1_masked = xingu_floodplain.updateMask(fp1).reduceToVectors({bestEffort:true})
print(fp1_masked, 'fp1_masked')
////////////// END MASKING OUT FLOODPLAIN //////////////
////////////// BEGIN COLLECTING NBRT INDEX IMAGES //////////////
// Normalized Burn Ratio Thermal (NBRT) for Landsat 5 imagery from -------------------------[
// https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C01_T1_ANNUAL_NBRT
// Set NBRT visibility parameters
var NBRT_Vis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
};
//Normalized Burn Ratio Thermal (NBRT) index for pre-burn
var NBRT_Images = ee.ImageCollection('LANDSAT/LT05/C01/T1_ANNUAL_NBRT')
.filterDate('1991-01-01', '1991-12-31');
var NBRT_2 = NBRT_Images.select('NBRT');
var NBRT_1991 = NBRT_2.filterBounds(LagoaKuhikugu).first();
print('NBRT_1991', NBRT_1991);
Map.addLayer(NBRT_1991, NBRT_Vis, 'NBRT_1991');
//Normalized Burn Ratio Thermal (NBRT) index for Post-burn imagery
var NBRT_Images1 = ee.ImageCollection('LANDSAT/LT05/C01/T1_ANNUAL_NBRT')
.filterDate('2011-01-01', '2011-12-31');
var NBRT = NBRT_Images1.select('NBRT')
var NBRT_2011 = NBRT.filterBounds(LagoaKuhikugu).first();
print ('NBRT_2011',NBRT_2011)
Map.addLayer(NBRT_2011, NBRT_Vis, 'NBRT_2019');
Map.setCenter(-53.12605910109288,-12.55589508222483,11);
////////////// END COLLECTING NBRT INDEX IMAGES //////////////
////////////// BEGIN COMPUTING DIFFERENCE BETWEEN PRE AND POST NBRT IMAGES //////////////
// (http://un-spider.org/advisory-support/recommended-practices/recommended-practice-burn-severity/in-detail/normalized-burn-ratio)
var NBRT_Difference = NBRT_1991.select('NBRT').subtract(NBRT_2011.select('NBRT')).clip(fp1_masked)
print('NBRT_Difference', NBRT_Difference);
// Set visible parameters to view NBRT_Difference layer. Use inspector to see range of pixel values
var Difference_visParams = {
min: -0.2,
max: 0.2,
palette: ['000000', 'FFFFFF'],
};
Map.addLayer(NBRT_Difference, Difference_visParams, 'NBRT_Difference');
////////////// END COMPUTING DIFFERENCE BETWEEN PRE AND POST NBRT IMAGES //////////////
////////////// BEGIN MASKING OUT BURNED AREAS //////////////
//define threshold, if dNBR is less than or equal to (0.01), return those pixels
var threshold2 = NBRT_Difference.lte(0.01)
// This feature (burns_removed), with areas of burn scars removed, can be used to clip
// imagery to disclude these regions that would otherwise produce noise in the model
var burns_removed = NBRT_Difference.updateMask(threshold2)
.toInt()
.reduceToVectors( //Reduces like-pixels to vectors (features AKA polygons) of non-burned areas
{geometry:Xingu_indig_area,
scale:30, //30m is spatial resolution of Landsat imagery
bestEffort:true}
);
print('burns_removed', burns_removed)
Map.addLayer(burns_removed, Difference_visParams,'burns_removed')
////////////// END MASKING OUT BURNED AREAS //////////////
////// IF WANTING TO EXPORT THESE FEATURES //////
// Export.table.toAsset(burns_removed, 'burns_removed_1991_2011') //Must commit change in Tasks tab
// Use this NBRT_Difference as a fire scar removal technique for modern
// day imagery. Beware cloud cover in NBR images if changing years of imagery.