【发布时间】:2020-05-07 12:24:18
【问题描述】:
我想重新分类全球森林数据值,即喜欢
0 - 20 % --> 1
21 - 49 % --> 0.5
50 - 100 % --> 0
但是,我无法找到如何为 GEE 中的范围执行此操作。可以在此处找到重新分类单个数字的说明:
但是很难找到简单的范围程序(没有决策树)。 有人可以为此提供一个简单的解决方案吗?
// Example from https://developers.google.com/earth-engine/resample
// Load a MODIS EVI image.
var modis = ee.Image(ee.ImageCollection('MODIS/006/MOD13A1').first())
.select('EVI');
// Get information about the MODIS projection.
var modisProjection = modis.projection();
// Load and display forest cover data at 30 meters resolution.
var forest = ee.Image('UMD/hansen/global_forest_change_2015')
.select('treecover2000');
// Get the forest cover data at MODIS scale and projection.
var forestMean = forest
// Force the next reprojection to aggregate instead of resampling.
.reduceResolution({
reducer: ee.Reducer.mean(),
maxPixels: 1024,
bestEffort:true
})
// Request the data at the scale and projection of the MODIS image.
.reproject({
crs: modisProjection
});
【问题讨论】:
-
注意:请将未来的 Earth Engine 问题发送至 GIS Stack Exchange (google-earth-engine tag),以帮助整合问题,以便 EE 社区更容易发现和参与。