【发布时间】:2017-09-08 09:23:02
【问题描述】:
我尝试将新功能添加到大型功能集合中,但使用函数 set() 会覆盖每个功能的整个列表。但我的目的是将数组中的每个值添加到相应的 FeatureCollection 中。有人可以帮帮我吗?
var table = ee.FeatureCollection(ft:.....blablabla);
**//Create an Array from the property DN in the FeatureCollection:**
var propert = table.limit(100).aggregate_array('DN');
*// Values less than 1 will be set to 1, larger than 1== 0:*
var limit = ee.Array(propert).lt(1);
print(limit);
//Function, that add the list! of features (limit) to new property (Class) in the FeatureCollection ("table").
var addFeature = function(ar) {
return ar.set({Class: limit});
//Map throw the Featurecollection table
var areaAdded = table.limit(100).map(addArea);
};
所以,如果您可以看到,我的代码将整个数组 [limit] 添加到 FeatureCollection 中的每个属性,而不是数组中的第一个值添加到第一个属性等等... 有人可以帮助我吗?谢谢
【问题讨论】:
标签: arrays properties set google-earth-engine