ee.Image.gt

如果且僅當 image1 和 image2 中每個相符的波段對,第一個值都大於第二個值,則傳回 1。如果 image1 或 image2 只有 1 個頻帶,則會與另一張圖片中的所有頻帶進行比較。如果圖片的波段數量相同,但名稱不同,系統會依自然順序成對使用。輸出頻帶會以較長的輸入命名,如果長度相同,則會以 image1 的順序命名。輸出像素的類型為布林值。

用量傳回
Image.gt(image2)圖片
引數類型詳細資料
這個:image1圖片用來擷取左運算元頻帶的圖片。
image2圖片系統會從這張圖片擷取右運算元頻帶。

範例

程式碼編輯器 (JavaScript)

// Show world oceans in blue and anything higher than the ellipsoid as gray.
// The bedrock layer is generally close to the geoid (sealevel).
var elevation = ee.Image('NOAA/NGDC/ETOPO1').select('bedrock');
var waterLand = elevation.gt(0.0);
var waterLandViz = {palette: ['cadetblue', 'lightgray']};
Map.addLayer(waterLand, waterLandViz, 'water_land');

Python 設定

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

import ee
import geemap.core as geemap

Colab (Python)

# Show world oceans in blue and anything higher than the ellipsoid as gray.
# The bedrock layer is generally close to the geoid (sealevel).
elevation = ee.Image('NOAA/NGDC/ETOPO1').select('bedrock')
water_land = elevation.gt(0.0)
water_land_viz = {'palette': ['cadetblue', 'lightgray']}
m = geemap.Map()
m.add_layer(water_land, water_land_viz, 'water_land')
m