ee.Array.first

Seleciona o valor do primeiro valor com base em elementos.

UsoRetorna
Array.first(right)Matriz
ArgumentoTipoDetalhes
isso: leftMatrizO valor à esquerda.
rightMatrizO valor à direita.

Exemplos

Editor de código (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]

Configuração do Python

Consulte a página Ambiente Python para informações sobre a API Python e como usar geemap para desenvolvimento interativo.

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]