一、基于GEE平台获取Landsat 8 L2级产品获取点位的地表发射率
代码如下(还进行了去云处理):
// 定义点,坐标,坐标系
var p1 = ee.Geometry.Point([140.5891,-34.0021], "EPSG:4326")//经纬度
// 将点集成列表,可以写入多个点
var pts = ee.FeatureCollection(ee.List([ee.Feature(p1).set('name','p1')]))
// 去云函数,以Landsat8为例
function maskL8sr(image){
// Bits 4 and 3 are cloud shadow and cloud, respectively.
var cloudShadowBitMask = (1 << 4);
var cloudsBitMask = (1 << 3);
// Get the pixel QA band.
var qa = image.select('QA_PIXEL');
// Both flags should be set to zero, indicating clear conditions.
var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
.and(qa.bitwiseAnd(cloudsBitMask).eq(0));
return image.updateMask(mask);
}
// 产生数据集
var dataset = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
.filterDate('2013-01-01','2014-12-31')
.filterBounds(pts)
.map(maskL8sr)
.select('ST_EMIS')
var ft = ee.FeatureCollection(ee.List([]))
var fill = function(img, ini) {
var inift = ee.FeatureCollection(ini)
var ft2 = img.sampleRegions({
collection:pts,
properties:ee.List(['name']),
scale:30
});
var date = img.date().format()
var ft3 = ft2.map(function(f){return f.set("date", date)})
return inift.merge(ft3)
}
// 迭代获取影像集中每一幅影像的值
var newft = ee.FeatureCollection(dataset.iterate(fill, ft))
// 结果输出
Export.table.toDrive({
collection: newft,
description: 'FSL_AU-Cpr',
fileFormat: 'CSV'
});
希望以上对大家有所帮助…
长路漫漫唯有坚持…