ee.Array

Retorna uma matriz com as coordenadas especificadas.

UsoRetorna
ee.Array(values, pixelType)Matriz
ArgumentoTipoDetalhes
valuesObjetoUma matriz para conversão ou um número/lista de números/lista aninhada de números de qualquer profundidade para criar uma matriz. Para listas aninhadas, todas as matrizes internas na mesma profundidade precisam ter o mesmo comprimento, e os números só podem estar presentes no nível mais profundo.
pixelTypePixelType, padrão: nullO tipo de cada número no argumento "values". Se o tipo de pixel não for fornecido, ele será inferido dos números em "values". Se não houver números em "values", esse tipo precisará ser fornecido.

Exemplos

Editor de código (JavaScript)

// Requires an explicit PixelType if no data.
print(ee.Array([], ee.PixelType.int8()));  // Empty []
print(ee.Array([[]], ee.PixelType.uint8()));  // Empty [[]]
print(ee.Array([[], []], ee.PixelType.float()));  // Empty [[], []]

// 1-D Arrays
print(ee.Array([0]));  // [0]
print(ee.Array([0, 1]));  // [0, 1]
// 2-D Arrays
print(ee.Array([[1]]));  // [[1]]
print(ee.Array([[0, 1], [2, 3]]));  // [[0,1],[2,3]]

// Arrays from ee.Number.
print(ee.Array([ee.Number(123).toUint8()]));  // [123]

// Lists are useful ways to construct larger Arrays.
print(ee.Array(ee.List.sequence(0, 10, 2)));  // // [0,2,4,6,8,10]

// Arrays can be used to make Arrays.
var array1D = ee.Array([1, 2, 3]);
// This is a cast.
print(ee.Array(array1D));  // [1,2,3]

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)

# Requires an explicit PixelType if no data.
print(ee.Array([], ee.PixelType.int8()).getInfo())  # Empty []
print(ee.Array([[]], ee.PixelType.uint8()).getInfo())  # Empty [[]]
print(ee.Array([[], []], ee.PixelType.float()).getInfo())  # Empty [[], []]

# 1-D Arrays
print(ee.Array([0]).getInfo())  # [0]
print(ee.Array([0, 1]).getInfo())  # [0, 1]
# 2-D Arrays
print(ee.Array([[1]]).getInfo())  # [[1]]
print(ee.Array([[0, 1], [2, 3]]).getInfo())  # [[0,1],[2,3]]

# Arrays from ee.Number.
print(ee.Array([ee.Number(123).toUint8()]).getInfo())  # [123]

# Lists are useful ways to construct larger Arrays.
print(ee.Array(ee.List.sequence(0, 10, 2)).getInfo())  # [0, 2, 4, 6, 8, 10]

# Arrays can be used to make Arrays.
array_one = ee.Array([1, 2, 3])
# This is a cast.
print(ee.Array(array_one).getInfo())  # [1, 2, 3]