ee.Array.first

Seleziona il valore del primo valore in base agli elementi.

UtilizzoResi
Array.first(right)Array
ArgomentoTipoDettagli
questo: leftArrayIl valore a sinistra.
rightArrayIl valore a destra.

Esempi

Editor di codice (JavaScript)

var empty = ee.Array([], ee.PixelType.int8());
print(empty.first(empty));  // []

print(ee.Array([0]).first(0));  // [0]
print(ee.Array([0, 1, 2]).first(1));  // [0,1,2]
print(ee.Array([0, 1, 2]).first(ee.Array([3, 4, 5])));  // [0,1,2]
print(ee.Array([3, 4, 5]).first(ee.Array([0, 1, 2])));  // [3,4,5]

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)

empty = ee.Array([], ee.PixelType.int8())
display(empty.first(empty))  # []

display(ee.Array([0]).first(0))  # [0]
display(ee.Array([0, 1, 2]).first(1))  # [0,1,2]
display(ee.Array([0, 1, 2]).first(ee.Array([3, 4, 5])))  # [0, 1, 2]
display(ee.Array([3, 4, 5]).first(ee.Array([0, 1, 2])))  # [3, 4, 5]