添加一个渐变图层
主要功能
新建一个像素面积为像元值的图层,呈现出渐变效果。
代码
// Displays the decreasing area covered by a single pixel at
// higher latitudes using the Image.pixelArea() function.
// Create an image in which the value of each pixel is its area.
var img = ee.Image.pixelArea();
Map.setCenter(0, 0, 3);
Map.addLayer(img, {min: 2e8, max: 4e8, opacity: 0.85}, 'pixel area');
步骤分析
- 创建ee对象,是一个ee的像素对象
- 设置地图中心,缩放等级
- 添加图层,显示结果
主要方法
- ee.Image.pixelArea()
Generate an image in which the value of each pixel is the area of that pixel in square meters.
No arguments.
Returns: Image
生成一个影像对象,每一个像素的像素值是该像素值的面积(平方米)
网友评论