ee.Image.gt

当且仅当 image1 和 image2 中每个匹配的波段对的第一个值大于第二个值时,返回 1。如果 image1 或 image2 只有一个波段,则会将其与另一张图片中的所有波段进行比较。如果图片具有相同数量的波段,但名称不同,则会按自然顺序成对使用。输出波段的命名方式为:如果两个输入的长度不同,则以较长的输入命名;如果长度相同,则以 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 API 和如何使用 geemap 进行交互式开发,请参阅 Python 环境页面。

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