从Google Earth Engine导出Sentinel-2无云图像集合

时间:2019-07-17 21:03:08

标签: google-earth-engine sentinel2

我想从Google Earth引擎导出合成的无云Sentinel-2图像,该图像可编译2017年至今的数据。我希望为每个乐队导出复合材料。

function maskS2clouds(image) {
  var qa = image.select('QA60');

  // Bits 10 and 11 are clouds and cirrus, respectively.
  var cloudBitMask = 1 << 10;
  var cirrusBitMask = 1 << 11;

  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
      .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

  return image.updateMask(mask).divide(10000);
}


// Filter to only include images intersecting Colorado or Utah.
var polygon = ee.Geometry.Polygon({
  coords: [[[-135.3539859086835, 64.45205192005692],
          [-135.3539859086835, 64.00063248338122],
          [-134.008160713371, 64.00063248338122],
          [-134.008160713371, 64.45205192005692]]],
  geodesic: false
});

// Map the function over one year of data and take the median.
// Load Sentinel-2 TOA reflectance data.
var dataset = ee.ImageCollection('COPERNICUS/S2')
                  .filterDate('2018-01-01', '2019-07-17')
                   .filter(ee.Filter.calendarRange(6,9,'month'))
                  .filterBounds(polygon)
                  // Pre-filter to get less cloudy granules.
                  .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 30))
                  .map(maskS2clouds);

var rgbVis = {
  min: 0.0,
  max: 0.3,
  bands: ['B4', 'B3', 'B2'],
};

0 个答案:

没有答案