GEE提取塔里木河流域水体
时间: 2023-12-15 10:07:07 浏览: 159
您好,使用Google Earth Engine提取塔里木河流域的水体可以按照以下步骤进行:
1. 打开Google Earth Engine Code Editor(https://code.earthengine.google.com/);
2. 在左上角的搜索栏中输入“Tianshan Systems”,并选择“Tianshan Systems / Rivers in Tianshan”数据集;
3. 在代码编辑器中输入以下代码:
```
var Tianshan = ee.FeatureCollection('Tianshan Systems/Rivers in Tianshan');
Map.addLayer(Tianshan);
var water = ee.Image('JRC/GSW1_0/GlobalSurfaceWater');
var occurrence = water.select('occurrence');
var water_mask = occurrence.gt(90);
Map.addLayer(water_mask, {}, 'water mask');
var water_shp = water_mask.reduceToVectors({
geometry: Tianshan,
crs: water.projection(),
scale: 30,
geometryType: 'polygon',
eightConnected: false,
labelProperty: 'water',
reducer: ee.Reducer.mean()
});
Map.addLayer(water_shp, {}, 'water layer');
```
4. 运行代码后,在地图上会显示出提取出来的水体图层。
这段代码首先导入了Tianshan Systems中的“Rivers in Tianshan”数据集,然后通过JRC Global Surface Water数据集提取出了水体,并使用reduceToVectors函数将水体转换成矢量数据,并将其与Tianshan数据集进行裁剪。最后在地图上显示了提取出来的水体图层。
阅读全文