GEE image和image collection关系

前提是数据集是单幅影像构成的,如果影像是多幅拼接的,就无法筛选出来

下面的代码是使用collection获得固定时间和固定地点筛选出来的数据集

var dataset = ee.ImageCollection("LANDSAT/LC08/C02/T1_TOA")
.filterDate('2017-01-01', '2017-01-08')
.filterBounds(ee.Geometry.Point(-122.3252, 37.5141))
print(dataset)
var trueColor432 = dataset.select(['B4', 'B3', 'B2']);
var trueColor432Vis = {
min: 0.0,
max: 0.4,
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(trueColor432, trueColor432Vis, 'True Color (432)');

下面的代码是选择上面筛选出来的单幅图像,并单独使用假彩色表现。

// Load an image.
var image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20170105');

// Define the visualization parameters.
var vizParams = {
bands: ['B5', 'B4', 'B3'],
min: 0,
max: 0.5,
gamma: [0.95, 1.1, 1]
};

// Center the map and display the image.
Map.setCenter(-122.1899, 37.5010, 10); // San Francisco Bay
Map.addLayer(image, vizParams, 'false color composite');

posted @ 2022-04-15 20:19  junjunang  阅读(162)  评论(0编辑  收藏  举报