.geometry(),这个方法主要是将你的影像进行几何化,也就是相当于用你之前在GEE地图上画的哪些区域,通过点的形式将其统计和转化。
paint(featureCollection, color, width)
Paints the geometries of a collection onto an image.将集合的几何图形绘制到图像上
this:image (Image):选取需要绘制的影像
The image on which the collection is painted.在这个集合当中的影像绘制
featureCollection (FeatureCollection):矢量集合
The collection painted onto the image.把这个集合绘制在影像上
color (Object, default: 0):颜色调价,一般是颜色对应的名称或者数字
Either the name of a color property or a number.
width (Object, default: null):
线宽属性的名称或数字
Either the name of a line-width property or a number.
具体使用方法如下
//数据是从Landsat8中选取美国旧金山的一景影像
var image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00')
.select(['B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B10', 'B11']);
// Display the input imagery and the region in which to do the PCA.显示输入图像和进行 PCA 的区域选择。
var region = image.geometry();
Map.centerObject(region, 10);
Map.addLayer(ee.Image().paint(region, 0, 2), {}, 'Region');
Map.addLayer(image, {bands: ['B5', 'B4', 'B2'], min: 0, max: 20000}, 'Original Image');
原始影像如下:
通过'B5', 'B4', 'B2'波段合成的影像:而且显示区域只有你选择的这副影像
'B4', 'B3', 'B2'波段合成的影像
这就是这个简单的功能,说白了就是将你的影像作为你的研究区域进行分析,虽然这个功能不是很常用,但是在很多时候你没有固定的边界或者自己的矢量边界的时候,这或许是一种个不错的选择,否则,你只能自己进行区域的划定,来选出自己想要的东西。