Google Earth Engine(GEE)——ImageCollection (Error)遍历影像集合产生的错误
失败并出现此错误:
That failed with this error:
ImageCollection (Error)
ImageCollection.fromImages, argument 'images': Invalid type. Expected type: List<Image<unknown bands>>. Actual type: Image<[daymet_01_20150101_hourly_temp, daymet_01_20150101_rel_hum,
daymet_02_20150101_hourly_temp,
daymet_02_20150101_rel_hum,
daymet_03_20150101_hourly_temp,
daymet_03_20150101_rel_hum,
图像收集(错误)
ImageCollection.fromImages,参数“图像”:无效类型。预期类型:List<Image<unknown band>>。实际类型:Image<[daymet_01_20150101_hourly_temp, daymet_01_20150101_rel_hum,
daymet_02_20150101_hourly_temp,
daymet_02_20150101_rel_hum,
daymet_03_20150101_hourly_temp,
daymet_03_20150101_rel_hum,
原始代码:
-
var tmrh = ee.Image('users/japolo/temp_min_max/tmnr_15_q1');
-
var tmrh2 = ee.ImageCollection(tmrh);
-
-
-
var tmrh2 = ee.List(tmrh);
-
var tmrh3 = ee.ImageCollection(tmrh2);
-
print( tmrh3);
-
这里的错误是不能直接使用ee.List()去遍历影像,而是用GEE中内置的
ee.ImageCollection.fromImages(images)
Returns the image collection containing the given images.
Arguments:
images (List):
The images to include in the collection.
Returns: ImageCollection
修改后的代码:
-
var image = ee.Image("users/japolo/temp_min_max/tmnr_15_q1");
-
-
var bands = image.bandNames();
-
print(bands);
-
var imageBandsAsList = bands.map(function(b) {
-
var imageBand = image.select(ee.String(b));
-
// 在这里,将属性 "system:time_start "与乐队的时间戳(以毫秒为单位)进行设置。
-
// ee.Date.millis()这里或许能用的上在设置影像时间上
-
return imageBand.copyProperties(image, ['system:time_start']);
-
});
-
var ic = ee.ImageCollection.fromImages(imageBandsAsList);
-
print(ic);


文章来源: blog.csdn.net,作者:此星光明2021年博客之星云计算Top3,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/qq_31988139/article/details/125398922
- 点赞
- 收藏
- 关注作者
评论(0)