ee.ImageCollection.toList

แสดงผลองค์ประกอบของคอลเล็กชันเป็นรายการ

การใช้งานการคืนสินค้า
ImageCollection.toList(count, offset)รายการ
อาร์กิวเมนต์ประเภทรายละเอียด
ดังนี้ collectionFeatureCollectionคอลเล็กชันอินพุตที่จะดึงข้อมูล
countจำนวนเต็มจำนวนสูงสุดขององค์ประกอบที่จะดึงข้อมูล
offsetจำนวนเต็ม ค่าเริ่มต้น: 0จำนวนองค์ประกอบที่จะทิ้งจากจุดเริ่มต้น หากตั้งค่าไว้ ระบบจะดึงข้อมูลองค์ประกอบ (ออฟเซ็ต + จำนวน) และทิ้งองค์ประกอบออฟเซ็ตแรก

ตัวอย่าง

โปรแกรมแก้ไขโค้ด (JavaScript)

// Note: ee.ImageCollection.toList may take a lot of time and memory to run,
// since it must generate all of the results in order to gather them into a
// list. Large collections and/or complex computations can produce memory
// limitation errors.

// A Landsat 8 TOA image collection (1 year of images at a specific point).
var col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA')
  .filterBounds(ee.Geometry.Point(-90.70, 34.71))
  .filterDate('2020-01-01', '2021-01-01');
print('Image collection', col);

// Get the first 3 images as a list of images.
var imgListFirst3 = col.toList(3);
print('First 3 images', imgListFirst3);

// Get the second 3 images as a list of images (use the offset parameter).
var imgListSecond3 = col.toList(3, 3);
print('Second 3 images', imgListSecond3);

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า สภาพแวดล้อม Python

import ee
import geemap.core as geemap

Colab (Python)

# Note: ee.ImageCollection.toList may take a lot of time and memory to run,
# since it must generate all of the results in order to gather them into a
# list. Large collections and/or complex computations can produce memory
# limitation errors.

# A Landsat 8 TOA image collection (1 year of images at a specific point).
col = ee.ImageCollection('LANDSAT/LC08/C02/T1_TOA').filterBounds(
    ee.Geometry.Point(-90.70, 34.71)).filterDate('2020-01-01', '2021-01-01')
print('Image collection:', col.getInfo())

# Get the first 3 images as a list of images.
img_list_first3 = col.toList(3)
print('First 3 images:', img_list_first3.getInfo())

# Get the second 3 images as a list of images (use the offset parameter).
img_list_second3 = col.toList(3, 3)
print('Second 3 images:', img_list_second3.getInfo())