7.15号之前
7.28号之后
代码:
// 这些 Sentinel-1 图像跟踪了 2018 年缅甸的主要洪水 // 季风季节:https://www.bbc.com/news/world-asia-44962585 var images = { '2018-07-21': getWeeklySentinelComposite('2018-07-21'), '2018-07-28': getWeeklySentinelComposite('2018-07-28'), '2018-08-18': getWeeklySentinelComposite('2018-08-18'), '2018-09-15': getWeeklySentinelComposite('2018-09-15'), }; // 在给定日期之后的 7 天(含)内合成 Sentinel-1 ImageCollection function getWeeklySentinelComposite(date) { var date = ee.Date(date); // Only include the VV polarization, for consistent compositing. var polarization = 'VV'; var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD') .filterDate(date, date.advance(1, 'week')) .filter(ee.Filter.listContains( 'transmitterReceiverPolarisation', polarization)) .filter(ee.Filter.eq('instrumentMode', 'IW')) .select(polarization) .mean(); return sentinel1.visualize({min: -25, max: 0, palette: ['aqua', 'black']}); } /* * 设置地图和控制小部件 */ //创建左侧地图,并让它显示图层 0。 var leftMap = ui.Map(); leftMap.setControlVisibility(false); var leftSelector = addLayerSelector(leftMap, 0, 'top-left'); // 创建正确的地图,并让它显示第 1 层。 var rightMap = ui.Map(); rightMap.setControlVisibility(false); var rightSelector = addLayerSelector(rightMap, 1, 'top-right'); // 向给定地图添加图层选择小部件,以允许用户更改哪个图像显示在关联的地图中。 function addLayerSelector(mapToChange, defaultValue, position) { var label = ui.Label('Choose an image to visualize'); // 此函数更改给定的地图以显示所选图像。 function updateMap(selection) { mapToChange.layers().set(0, ui.Map.Layer(images[selection])); } // 配置选择下拉菜单以允许用户在图像之间进行选择, // 并将地图设置为在用户进行选择时更新。 var select = ui.Select({items: Object.keys(images), onChange: updateMap}); select.setValue(Object.keys(images)[defaultValue], true); var controlPanel = ui.Panel({widgets: [label, select], style: {position: position}}); mapToChange.add(controlPanel); } /* * 把所有东西绑在一起 */ // 创建一个 SplitPanel 来保存相邻的链接地图。 var splitPanel = ui.SplitPanel({ firstPanel: leftMap, secondPanel: rightMap, wipe: true, style: {stretch: 'both'} }); // 将 SplitPanel 设置为 UI 根目录中的唯一内容。 ui.root.widgets().reset([splitPanel]); var linker = ui.Map.Linker([leftMap, rightMap]); leftMap.setCenter(96.7846, 17.6623, 12);