1. 程式人生 > 其它 >GEE image和image collection關係

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');