Earth Engine sta introducendo
livelli di quota non commerciali per salvaguardare le risorse di calcolo condivise e garantire prestazioni affidabili per tutti. Tutti i progetti non commerciali dovranno selezionare un livello di quota entro il
27 aprile 2026, altrimenti verrà utilizzato il livello Community per impostazione predefinita. Le quote di livello entreranno in vigore per tutti i progetti (indipendentemente dalla data di selezione del livello) il
27 aprile 2026.
Scopri di più.
ee.List.splice
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
A partire dall'indice iniziale, rimuove gli elementi di conteggio dall'elenco e inserisce i contenuti di other in quella posizione. Se start è negativo, il conteggio viene eseguito all'indietro dalla fine dell'elenco.
| Utilizzo | Resi |
|---|
List.splice(start, count, other) | Elenco |
| Argomento | Tipo | Dettagli |
|---|
questo: list | Elenco | |
start | Numero intero | |
count | Numero intero | |
other | Elenco, valore predefinito: null | |
Esempi
Editor di codice (JavaScript)
// An ee.List object.
var list = ee.List([0, 1, 2, 3, 4]);
print('Original list', list);
// If "other" argument is null, elements at positions specified by "start" and
// "count" are deleted. Here, the 3rd element is removed.
print('Remove 1 element', list.splice({start: 2, count: 1, other: null}));
// If "start" is negative, the position is from the end of the list.
print('Remove 2nd from last element', list.splice(-2, 1));
// Deletes 3 elements starting at position 1.
print('Remove multiple sequential elements', list.splice(1, 3));
// Insert elements from the "other" list without deleting existing elements
// by specifying the insert "start" position and setting "count" to 0.
print('Insert new elements', list.splice(2, 0, ['X', 'Y', 'Z']));
// Replace existing elements with those from the "other" list by specifying the
// "start" position to replace and the "count" of proceeding elements. If
// length of "other" list is greater than "count", the remaining "other"
// elements are inserted, they do not replace existing elements.
print('Replace elements', list.splice(2, 3, ['X', 'Y', 'Z']));
Configurazione di Python
Consulta la pagina
Ambiente Python per informazioni sull'API Python e sull'utilizzo di
geemap per lo sviluppo interattivo.
import ee
import geemap.core as geemap
Colab (Python)
# An ee.List object.
ee_list = ee.List([0, 1, 2, 3, 4])
display('Original list:', ee_list)
# If "other" argument is None, elements at positions specified by "start" and
# "count" are deleted. Here, the 3rd element is removed.
display('Remove 1 element:',
ee_list.splice(start=2, count=1, other=None))
# If "start" is negative, the position is from the end of the list.
display('Remove 2nd from last element:', ee_list.splice(-2, 1))
# Deletes 3 elements starting at position 1.
display('Remove multiple sequential elements:', ee_list.splice(1, 3))
# Insert elements from the "other" list without deleting existing elements
# by specifying the insert "start" position and setting "count" to 0.
display('Insert new elements:', ee_list.splice(2, 0, ['X', 'Y', 'Z']))
# Replace existing elements with those from the "other" list by specifying the
# "start" position to replace and the "count" of proceeding elements. If
# length of "other" list is greater than "count", the remaining "other"
# elements are inserted, they do not replace existing elements.
display('Replace elements:', ee_list.splice(2, 3, ['X', 'Y', 'Z']))
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-10-30 UTC.
[null,null,["Ultimo aggiornamento 2025-10-30 UTC."],[],[]]