ee.Array

指定された座標を含む配列を返します。

用途戻り値
ee.Array(values, pixelType)配列
引数タイプ詳細
valuesオブジェクトキャストする既存の配列、または配列の作成元となる任意の深さの数値/数値のリスト/数値のネストされたリスト。ネストされたリストの場合、同じ深さにあるすべての内部配列は同じ長さにする必要があります。数値は最も深いレベルにのみ存在できます。
pixelTypePixelType、デフォルト: nullvalues 引数の各数値の型。ピクセルタイプが指定されていない場合は、'values' の数値から推測されます。「values」に数値がない場合は、このタイプを指定する必要があります。

コードエディタ(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]

Python の設定

Python API とインタラクティブな開発での geemap の使用については、 Python 環境のページをご覧ください。

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]