美文网首页GEE案例
GEE影像分段拉伸

GEE影像分段拉伸

作者: 赤豆冰棍 | 来源:发表于2019-01-03 16:29 被阅读0次

在特定影像值范围内,显示影像,范围外的值均被替换为最低值或最高值

主要功能

使用SRTM数据,实现1000到2000米高程内数据的展示

代码

// ee.Image.clamp() example.

// Clamp the values of all bands in an image to lie within the specified range.
// Values below the low value of that range are set to low value, values above
// the high value of that range are set to the high value.

var image = ee.Image('CGIAR/SRTM90_V4');
var clamped = image.clamp(1000, 2000);

Map.setCenter(-121.753, 46.855, 9);
Map.addLayer(image, {min: 0, max: 4300}, 'Full stretch');
Map.addLayer(clamped, {min: 0, max: 4300}, 'Clamped');

步骤分析

  1. 创建ee对象,获取SRTM数据
  2. 在[1000,2000]范围内对SRTM数据进行拉伸
  3. 设置地图显示中心,缩放等级
  4. 添加原始图层
  5. 添加拉伸结果图层

主要方法

  1. ee.Image.clamp()
    Clamps the values in all bands of an image to all lie within the specified range.
    Arguments:
    this:input (Image):
    The image to clamp.
    low (Float):
    The minimum allowed value in the range.
    high (Float):
    The maximum allowed value in the range.
    Returns: Image

拉伸指定值域范围内的数据,值域外进行掩膜。
输入参数:
输入影像对象,最小值,最大值

相关文章

网友评论

    本文标题:GEE影像分段拉伸

    本文链接:https://www.haomeiwen.com/subject/inxqrqtx.html