Ogłoszenie: wszystkie projekty niekomercyjne zarejestrowane do korzystania z Earth Engine przed
15 kwietnia 2025 r. muszą
potwierdzić spełnianie warunków użycia niekomercyjnego , aby zachować dostęp. Jeśli nie przejdziesz weryfikacji do 26 września 2025 r., Twój dostęp może zostać wstrzymany.
Prześlij opinię
ee.List.get
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zwraca element na określonej pozycji na liście. Ujemny indeks liczy się wstecz od końca listy.
Wykorzystanie Zwroty List. get (index)
Obiekt
Argument Typ Szczegóły to: list
Lista index
Liczba całkowita
Przykłady
Edytor kodu (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 ));
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap
do interaktywnego programowania znajdziesz na stronie
Środowisko Python .
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 ())
Prześlij opinię
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0 , a fragmenty kodu są dostępne na licencji Apache 2.0 . Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers . Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
Chcesz przekazać coś jeszcze?
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-26 UTC."],[],[]]