此处是入口,本在线平台需要科学上网
![](https://img-blog.csdnimg.cn/img_convert/445d3bc594fe50fca5b65fcb3250eb0d.png)
![](https://img-blog.csdnimg.cn/img_convert/c413b9a47507a6651da4ecbd67fd689a.png)
用户界面
//此处导入自己的研究区
function maskL8sr(image) {
// The third bit is cloud and the fourth bit is cloudshadow。
var cloudShadowBitMask = 1 << 4;
var cloudsBitMask = 1 << 3;
// Get QA_PIXEL band.
var qa = image.select('QA_PIXEL');
// Set the cloud mask to zero
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
// Update the cloudmask
return image.updateMask(mask)
.select("SR_B.*")
.copyProperties(image, ["system:time_start"]);
}
// Map the function over 3 months of data and take the median.
// Load Landsat-8 surface reflectance data.
var landsat8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
.filterBounds(table2)
.filterDate('2020-04-29', '2020-04-30')
// Pre-filter to get less cloudy granules.
.filter(ee.Filter.lte('CLOUD_COVER',5))
.map(maskL8sr)
.median()
.clip(table2);
landsat8 = landsat8.uint16();
print(landsat8);// visualize the datasets
var rgbVis = {
min: 8400,
max: 15000,
gamma:1.5,
bands: ['SR_B4', 'SR_B3', 'SR_B2'],
};
Map.addLayer(landsat8,rgbVis,'landsat8');
var imgselect = landsat8.select('SR_B2','SR_B3','SR_B4','SR_B5');
//Export image to google drive and then download
Export.image.toDrive({
image:imgselect,
description:'s4',
scale:30,
region:table2,
folder:"result",
crs: "EPSG:4326",
maxPixels: 1e13
});