ee.ImageCollection.first

Trả về mục đầu tiên trong một tập hợp đã cho.

Cách sử dụngGiá trị trả về
ImageCollection.first()Hình ảnh
Đối sốLoạiThông tin chi tiết
this: imagecollectionImageCollectionĐối tượng ImageCollection.

Ví dụ

Trình soạn thảo mã (JavaScript)

var image = ee.ImageCollection('COPERNICUS/S2_SR').first();
Map.centerObject(image, 8);
var vis = {bands: ['B4', 'B3', 'B2'], min: 0, max: 5000};
Map.addLayer(image, vis, 'first of S2_SR');

// Display the image metadata.
print(image);

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về API Python và cách sử dụng geemap cho quá trình phát triển tương tác.

import ee
import geemap.core as geemap

Colab (Python)

image = ee.ImageCollection('COPERNICUS/S2_SR').first()
m = geemap.Map()
m.center_object(image, 8)
vis = {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 5000}
m.add_layer(image, vis, 'first of S2_SR')
display(m)

# Display the image metadata.
display(image)