-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSecondary_Vegetation_TIFfile_Export_Tool.js
72 lines (66 loc) · 2.54 KB
/
Secondary_Vegetation_TIFfile_Export_Tool.js
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
///// Assets /////
var loss = ee.Image("users/ybyrabr/public/secondary_vegetation_loss_collection8_v61"),
age = ee.Image("users/ybyrabr/public/secondary_vegetation_age_collection8_v61"),
extent = ee.Image("users/ybyrabr/public/secondary_vegetation_extent_collection8_v61"),
increment = ee.Image("users/ybyrabr/public/secondary_vegetation_increment_collection8_v61"),
mapbiomas = ee.Image('projects/mapbiomas-workspace/public/collection8/mapbiomas_collection80_integration_v1');
// Area of Interest (Brazil)
var aoi = ee.FeatureCollection("users/celsohlsj/brazil");
///// Type of Vegetation /////
// Here you select the type of secondary vegetation to be exported (forest or non-forest).
// Please refer to the legend document: https://brasil.mapbiomas.org/wp-content/uploads/sites/4/2023/08/Legenda-Colecao-8-LEGEND-CODE.pdf
var type = 3; // 1.1. Forest Formation: 3
var vegetation_type = mapbiomas.select('classification_1985').eq(type);
// Save Datasets
for (var i=1986; i<2023; i++) {
var y = i;
var year = 'classification_'+y;
var export_year = age.select(year).multiply(vegetation_type);
Export.image.toDrive({
image: export_year,
description: 'secondary_vegetation_age_v61_'+y,
scale: 30,
region: aoi,
folder: 'secondary_vegetation_collection8_v61',
maxPixels:1e13
});
}
for (var i=1986; i<2023; i++) {
var y = i;
var year = 'classification_'+y;
var export_year = extent.select(year).multiply(vegetation_type);
Export.image.toDrive({
image: export_year,
description: 'secondary_vegetation_extent_v61_'+y,
scale: 30,
region: aoi,
folder: 'secondary_vegetation_collection8_v61',
maxPixels:1e13
});
}
for (var i=1986; i<2023; i++) {
var y = i;
var year = 'classification_'+y;
var export_year = increment.select(year).multiply(vegetation_type);
Export.image.toDrive({
image: export_year,
description: 'secondary_vegetation_increment_v61_'+y,
scale: 30,
region: aoi,
folder: 'secondary_vegetation_collection8_v61',
maxPixels:1e13
});
}
for (var i=1987; i<2022; i++) {
var y = i;
var year = 'classification_'+y;
var export_year = loss.select(year).multiply(vegetation_type);
Export.image.toDrive({
image: export_year,
description: 'secondary_vegetation_loss_v61_'+y,
scale: 30,
region: aoi,
folder: 'secondary_vegetation_collection8_v5',
maxPixels:1e13
});
}