Thông báo : Tất cả dự án phi thương mại đã đăng ký sử dụng Earth Engine trước
ngày 15 tháng 4 năm 2025 phải
xác minh điều kiện sử dụng phi thương mại để duy trì quyền truy cập. Nếu bạn chưa xác minh trước ngày 26 tháng 9 năm 2025, quyền truy cập của bạn có thể bị tạm ngưng.
Gửi ý kiến phản hồi
ee.List.get
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trả về phần tử tại vị trí được chỉ định trong danh sách. Chỉ mục âm đếm ngược từ cuối danh sách.
Cách sử dụng Giá trị trả về List. get (index)
Đối tượng
Đối số Loại Thông tin chi tiết this: list
Danh sách index
Số nguyên
Ví dụ
Trình soạn thảo mã (JavaScript)
// An ee.List object.
var list = ee . List ([ 5 , 10 , 15 , 20 , 25 , 30 ]);
// Fetch elements at specified 0-based positions in the list.
print ( 'The second element' , list . get ( 1 ));
print ( 'The fourth element' , list . get ( 3 ));
print ( 'The last element' , list . get ( - 1 ));
print ( 'The second to last element' , list . get ( - 2 ));
// ee.Number and integer computed objects are valid inputs.
print ( 'Computed object index input' , list . get ( list . get ( 0 )));
// The result of ee.List.get is an ambiguous object type. You need to cast the
// result to the expected type to use it in subsequent instance methods. For
// example, if you are fetching a number and wish to add it to another number,
// you must cast the .get() result as an ee.Number.
print ( 'Add fetched number to another number' , ee . Number ( list . get ( 1 )). add ( 2 ));
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)
# An ee.List object.
ee_list = ee . List ([ 5 , 10 , 15 , 20 , 25 , 30 ])
# Fetch elements at specified 0-based positions in the list.
print ( 'The second element:' , ee_list . get ( 1 ) . getInfo ())
print ( 'The fourth element:' , ee_list . get ( 3 ) . getInfo ())
print ( 'The last element:' , ee_list . get ( - 1 ) . getInfo ())
print ( 'The second to last element:' , ee_list . get ( - 2 ) . getInfo ())
# ee.Number and integer computed objects are valid inputs.
print ( 'Computed object index input:' , ee_list . get ( list . get ( 0 )) . getInfo ())
# The result of ee.List.get is an ambiguous object type. You need to cast the
# result to the expected type to use it in subsequent instance methods. For
# example, if you are fetching a number and wish to add it to another number,
# you must cast the .get() result as an ee.Number.
print ( 'Add fetched number to another number:' ,
ee . Number ( list . get ( 1 )) . add ( 2 ) . getInfo ())
Gửi ý kiến phản hồi
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0 . Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers . Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
Bạn muốn chia sẻ thêm với chúng tôi?
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[]]