-
Notifications
You must be signed in to change notification settings - Fork 1
/
Animated Thumbnail
57 lines (52 loc) · 1.64 KB
/
Animated Thumbnail
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
/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var geometry =
/* color: #98ff00 */
/* shown: false */
/* displayProperties: [
{
"type": "rectangle"
}
] */
ee.Geometry.Polygon(
[[[-59.31816452789794, -38.35786805287858],
[-59.31816452789794, -38.37657618437273],
[-59.29344528961669, -38.37657618437273],
[-59.29344528961669, -38.35786805287858]]], null, false);
/***** End of imports. If edited, may not auto-convert in the playground. *****/
// Simple ImageCollection preview via animated GIF.
Map.centerObject(geometry, 13);
// Select MODIS vegetation composites from 2018.
var collection = ee.ImageCollection('COPERNICUS/S2')
//.filterDate('2000-01-01', '2019-12-31')
.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 5))
.filterBounds(geometry)
.select(['B4', 'B3', 'B2']);
// Add the first image to the map, just as a preview.
var img = ee.Image(collection.first());
Map.addLayer(img, {min: 0, max: 3000}, "first image");
// Create a video thumbnail and add it to the map.
var thumb = ui.Thumbnail({
// Specifying a collection for "image" animates the sequence of images.
image: collection,
params: {
crs: 'EPSG:3857', // Maps Mercator
dimensions: '300',
region: geometry,
min: 0,
max: 3000,
gamma: 1.4,
framesPerSecond: 10,
},
style: {
position: 'bottom-right',
width: '320px'
}});
Map.add(thumb);
// Export (change dimensions or scale for higher quality).
Export.video.toDrive({
collection: collection,
description: 'sfVideoExample',
dimensions: 720,
framesPerSecond: 12,
region: geometry
});