Google Earth Engine(GEE)DIY图例和导出

//加载数据
var ModisLc = ee.ImageCollection("MODIS/006/MCD12Q1"),
    geometry = 
    /* color: #d63000 */
    /* displayProperties: [
      {
        "type": "rectangle"
      }
    ] */
    ee.Geometry.Polygon(
        [[[109.6591796875, 37.430410309924575],
          [109.6591796875, 31.549551014402827],
          [118.6240234375, 31.549551014402827],
          [118.6240234375, 37.430410309924575]]], null, false);
var IGBPLc = ModisLc.select('LC_Type1');
// Force projection of 500 meters/pixel, which is the native MODIS resolution.
var SCALE = 500;
//裁剪数据 
var WulingLc = IGBPLc.map(function(img){
  img = img.reproject('EPSG:4326', null, SCALE)
  return img.clip(geometry);
})

//===========================展示数据start===========================
var date_begin = '2001-01-01', // begin time
    date_end   = '2018-12-31';
var WulingLcTime = WulingLc.filterDate(date_begin,date_end);
// 创建裂图例面板
var legend = ui.Panel({
  style: {
    position: 'bottom-left',
    padding: '8px 15px'
  }
});
// Create and add the legend title.
var legendTitle = ui.Label({
  value: 'MODIS Land Cover for IGBP Classification System',
  style: {
    fontWeight: 'bold',
    fontSize: '18px',
    margin: '0 0 4px 0',
    padding: '0'
  }
});
legend.add(legendTitle);

var loading = ui.Label('Loading legend...', {margin: '2px 0 4px 0'});
legend.add(loading);

// Creates and styles 1 row of the legend.
var makeRow = function(color, name) {
  // Create the label that is actually the colored box.
  var colorBox = ui.Label({
    style: {
      backgroundColor: '#' + color,
      // Use padding to give the box height and width.
      padding: '8px',
      margin: '0 0 4px 0'
    }
  });

  // Create the label filled with the description text.
  var description = ui.Label({
    value: name,
    style: {margin: '0 0 4px 6px'}
  });

  return ui.Panel({
    widgets: [colorBox, description],
    layout: ui.Panel.Layout.Flow('horizontal')
  });
};

// Get the list of palette colors and class names from the image.
var palette=[
    '05450a', '086a10', '54a708', '78d203', '009900', 'c6b044', 'dcd159',
    'dade48', 'fbff13', 'b6ff05', '27ff87', 'c24f44', 'a5a5a5', 'ff6d4c',
    '69fff8', 'f9ffa4', '1c0dff'
  ];
var names = [
    'Evergreen Needleleaf Forests', 'Evergreen Broadleaf Forests', 
    'Deciduous Needleleaf Forests', 'Deciduous Broadleaf Forests', 
    'Mixed Forests', 'Closed Shrublands', 'Open Shrublands',
    'Woody Savannas', 'Savannas', 'Grasslands', 'Permanent Wetlands', 
    'Croplands', 'Urban and Built-up Lands', 'Cropland/Natural Vegetation Mosaics',
    'Permanent Snow and Ice', 'Barren', 'Water Bodies'
];
var igbpLandCoverVis = {
  min: 1.0,
  max: 17.0,
  palette: palette,
};

Map.setCenter(109, 29,  6);
loading.style().set('shown', false);
for (var i = 0; i < names.length; i++) {
    legend.add(makeRow(palette[i], names[i]));
  }
  
var list = WulingLcTime.toList(1000);
var n = list.size().getInfo();
for (var i=0; i<n; i++){
  var image = ee.Image(list.get(i));
  var nameOut = ee.String(image.get('system:index')).getInfo()
  Map.addLayer(image, igbpLandCoverVis, nameOut);
}
// Add the legend to the map.
Map.add(legend);
//===========================展示数据end===========================
//下载数据  
var list = WulingLc.toList(1000);
var n = list.size().getInfo();
for (var i=0; i<n; i++){
  var image = ee.Image(list.get(i));
  var nameOut = ee.String(image.get('system:index')).getInfo()
  Export.image.toDrive({
    image: image, // 要下载的影像
    description: nameOut, // 下载任务描述,也是文件的默认名称
    folder: 'IGBPLandcover', // 选择要下载到云盘的哪个文件夹
    scale: 500, // 分辨率,默认值是500m
    maxPixels: 1e10 // 下载数据的最大像元数
  });
}

这里分界线

安利个看美剧背单词,练习听说的工具|美剧词典
在这里插入图片描述
美剧词典是一款短情景形式的英语学习工具。首先呢,颜值是十分高的,界面简洁,配色清新;其次,有才华啊,目前共收录了近10万条字幕数据,10万条短情景和80万条词汇。短情景均为几秒的无字幕原声经典美剧视频片段,不占用多少时间就能让你get到原汁原味的单词含义和用处啦。美剧词典现包括“查询”、“单词本”、“音频"和"我的”四项功能。

发布了13 篇原创文章 · 获赞 5 · 访问量 7738

猜你喜欢

转载自blog.csdn.net/weixin_43123242/article/details/103136453