ee.Array.or

以元素為單位,只有在任一輸入值不為零時,才會傳回 1。

用量傳回
Array.or(right)陣列
引數類型詳細資料
這個:left陣列左側值。
right陣列右側值。

範例

程式碼編輯器 (JavaScript)

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

print(ee.Array([0, 0, 1, 1]).or(ee.Array([0, 1, 0, 1])));  // [0,1,1,1]

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

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

# [0, 1, 1, 1]
display(ee.Array([0, 0, 1, 1]).Or(ee.Array([0, 1, 0, 1])))