-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiples_vistas
55 lines (41 loc) · 1.82 KB
/
Multiples_vistas
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
// http://www.gisandbeers.com/multiples-vistas-google-earth-engine/
// llamada a la coleccion de imagenes sentinel-2
var SENTINEL_2 = ee.ImageCollection("COPERNICUS/S2")
.filterDate('2018-01-01', '2018-01-05')
.filterMetadata('CLOUD_COVER', 'Less_Than', 20);
// Composicion de Indices y RGB
var Composiciones_RGB = {
'Color Natural RGB (4, 3, 2)': ['B4', 'B3', 'B2'],
'Urbano RGB (12, 11, 4)': ['B12', 'B11', 'B4'],
'Vegetación RGB (8, 4, 3)': ['B8', 'B4', 'B3'],
'Agricultura RGB (11, 8, 2)': ['B11', 'B8', 'B2']};
function Visualizacion(Bandas) {
return {gamma: 1.0, min: 0.0, max: 5000.0, bands: Bandas};}
// creacion y link de los mapas
var Panel_Mapas = [];
Object.keys(Composiciones_RGB).forEach(function(name) {
var Mapa = ui.Map();
Mapa.add(ui.Label(name));
Mapa.addLayer(SENTINEL_2, Visualizacion(Composiciones_RGB[name]), name);
Mapa.setControlVisibility(false);
Panel_Mapas.push(Mapa);});
var Linker = ui.Map(Panel_Mapas);
// Configuracion de la posicion de los mapas
var Map_Grid = ui.Panel ([
ui.Panel([Panel_Mapas[0]], null, {stretch: 'both'}),
ui.Panel([Panel_Mapas[1]], null, {stretch: 'both'}),
ui.Panel([Panel_Mapas[2]], null, {stretch: 'both'}),
ui.Panel([Panel_Mapas[3]], null, {stretch: 'both'}),],
ui.Panel.Layout.Flow('Horizontal'), {stretch: 'both'});
//controles de escala y titulos para el primer mapa
Panel_Mapas[0].setControlVisibility({zoomControl: true});
Panel_Mapas[0].setControlVisibility({scaleControl: true});
var Titulo = ui.Label ('Analitica de Imagenes Sentinel 2', {
stretch: 'horizontal',
textAlign: 'center',
fontWeeight: 'bold',
fontSize: '11 px'});
// centrar el mapa en una localizacion y añadir los titulos
Panel_Mapas[0].setCenter(-0.49, 41.43, 11);
ui.root.widgets().reset([Titulo, Map_Grid]);
ui.root.setLayout(ui.Panel.Layout.Flow('vertical'));