简介
我想使用重映射在 FeatureCollection 中创建一个新的 String 属性。由于我需要将一个 String 值重映射到另一个 String 值,所以我在 ee.FeatureCollection().remap() (‘lookupOut expects List’) 中遇到了错误。
FeatureCollection (Error)
Collection.remap, argument ‘lookupOut’: Invalid type.
Expected type: List.
Actual type: List.
Actual value: [natural, natural, developed, developed]
全部代码
// Google Earth Engine JavaScript API 错误报告
// FeatureCollection.remap() 文档说明它接受字符串和整数
// 但在使用字符串时会抛出错误
// 创建一个包含字符串属性的虚拟要素集合
var dummyFeatures = ee.FeatureCollection([
ee.Feature(ee.Geometry.Point([0, 0]), {
land_cover: 'forest', id: 1}), // 森林
ee.Feature(ee.Geometry.Point([1, 1]), {
land_cover: 'water', id: 2}), // 水体
ee.Feature(ee.Geometry.Point([2, 2]), {
land_cover: 'urban',