// Analisis de deforestacion en Google Earth Engine con datos radar de Sentinel 1 // http://www.gisandbeers.com/analisis-deforestacion-en-google-earth-engine-radar/ // Filtro de datos radar provenientes de la coleccion de Sentinel 1 var Radar = ee.ImageCollection('COPERNICUS/S1_GRD') .filter(ee.Filter.eq('instrumentMode', 'IW')).select('VH') .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING')) .filterMetadata('resolution_meters', 'equals' , 10) .filterBounds(geometry) .map(function(ImagenRadar) {var BordeTile = ImagenRadar.lt(-30.0); var Mascara = ImagenRadar.mask().and(BordeTile.not()); return ImagenRadar.updateMask(Mascara);}); // Delimitacion geometrica, desde en el visor, de la zona AOI para extraccion de datos // Definicion de momentos temporales de representacion var RadarT1 = ee.Filter.date('2017-01-01', '2017-12-31'); var RadarT2 = ee.Filter.date('2018-01-01', '2018-12-31'); var RadarT3 = ee.Filter.date('2019-01-01', '2019-12-31'); var T1VH = ee.Image.cat(Radar.filter(RadarT1).mean()).clip(geometry); var T2VH = ee.Image.cat(Radar.filter(RadarT2).mean()).clip(geometry); var T3VH = ee.Image.cat(Radar.filter(RadarT3).mean()).clip(geometry); // Composicion de imagen RGB var DEFORESTACION = T1VH.addBands(T2VH).addBands(T3VH); // Representacion de los momentos temporales e imagen multitemporal de cambios forestales Map.addLayer(T1VH, {min:-25,max:0, gamma: 0.9}, '2017 VH',0); Map.addLayer(T2VH, {min:-25,max:0, gamma: 0.9}, '2018 VH',0); Map.addLayer(T3VH, {min:-25,max:0, gamma: 0.9}, '2019 VH',0); Map.addLayer (DEFORESTACION, {max: 0.0, min: -25.0, gamma: 0.8,}, 'DEFORESTACION',1); // Configuracion del titulo, posicion y simbologia de la leyenda en el visor var Etiquetas = ['P-P-A','P-PP-A','P-A-A','P-A-PP','P-A-PP','PP-A-P','A-A-P','A-PP-P','A-P-P', 'A-P-PP','A-P-A','PP-P-A','P-P-P','A-A-A',]; var Titulo = ui.Label({ value: 'Análisis multitemporal forestal', // Titulo de la leyenda style: {fontWeight: 'bold', fontSize: '13px', margin: '0px 0px 10px 0px',}}); var Nota = ui.Label({ value: 'P=Presencia, PP=Presencia Parcial, A=Ausencial', style: {fontWeight: 'bold', fontSize: '7px', margin: '15px 0px 0px 0px',}}); var Leyenda = ui.Panel({ style: {position: 'bottom-left', padding: '10px 20px'}}); Leyenda.add(Titulo); var Simbologia = ['ffff00', 'ff6600', 'fe0000', 'ff309c', 'ff00ff', '802ca5', '0000fe', '0066ff', '00ffff', '01cb79', '00ce04', '4cf901', 'ffffff', '000000']; var Simbolos = function(simbolo, texto) { var TextoLeyenda = ui.Label({ value: texto, style: {fontSize: '9px', margin: '0px 0px 0px 10px'}}); var CajaLeyenda = ui.Label({ style: {backgroundColor: '#' + simbolo, padding: '7px', margin: '2px 0px 1px 0px'}}); return ui.Panel({ widgets: [CajaLeyenda, TextoLeyenda], layout: ui.Panel.Layout.Flow('horizontal')});}; for (var i = 0; i < 14; i++) {Leyenda.add(Simbolos(Simbologia[i], Etiquetas[i]));} Leyenda.add(Nota); Map.add(Leyenda); // Representacion de titulo del mapa var TituloMapa = ui.Label({ value: 'ANÁLISIS DE DEFORESTACIÓN MULTITEMPORAL', style: {fontWeight: 'bold', fontSize: '20px'}}); Map.add(TituloMapa);