GEE案例

GEE图像特征值标记

2019-01-05  本文已影响0人  赤豆冰棍

标记特定像素

主要功能

标记大于1000m的像素点,标记等于1000m的像素点

代码

// Mark pixels where the elevation crosses 1000m value and compare
// that to pixels that are exactly equal to 1000m.

var elev = ee.Image('CGIAR/SRTM90_V4');

// A zero-crossing is defined as any pixel where the right,
// bottom, or diagonal bottom-right pixel has the opposite sign.
var image = elev.subtract(1000).zeroCrossing();

Map.setCenter(-121.68148, 37.50877, 13);
Map.addLayer(image, {min: 0, max: 1, opacity: 0.5}, 'Crossing 1000m');

var exact = elev.eq(1000);
Map.addLayer(exact.updateMask(exact), {palette: 'red'}, 'Exactly 1000m');

步骤分析

  1. 创建ee对象,获取SRTM数据
  2. 使用SRTM数据减去1000m,然后选择结果大于0的部分
  3. 设置地图中心,缩放等级
  4. 添加图层,显示高程大于1000m的部分
  5. 选择SRTM数据中正好为1000m的像素
  6. 添加正好为1000m的图层

主要方法

  1. ee.Image.zeroCrossing()
    Finds zero-crossings on each band of an image.
    Arguments:
    this:image (Image):
    The image from which to compute zero crossings.
    Returns: Image

查找输入影像中与设定值相同的部分
输入参数:输入影像对象

上一篇 下一篇

猜你喜欢

热点阅读