Google Earth Engine(GEE)——ImageCollection (Error)遍历影像集合产生的错误

举报
此星光明 发表于 2022/06/27 23:40:42 2022/06/27
【摘要】 失败并出现此错误: That failed with this error:ImageCollection (Error) ImageCollection.fromImages, argument 'images': Invalid type. Expected type: List<Image<unknown bands...

失败并出现此错误:

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,

原始代码:


  
  1. var tmrh = ee.Image('users/japolo/temp_min_max/tmnr_15_q1');
  2. var tmrh2 = ee.ImageCollection(tmrh);
  3. var tmrh2 = ee.List(tmrh);
  4. var tmrh3 = ee.ImageCollection(tmrh2);
  5. 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

修改后的代码:


  
  1. var image = ee.Image("users/japolo/temp_min_max/tmnr_15_q1");
  2. var bands = image.bandNames();
  3. print(bands);
  4. var imageBandsAsList = bands.map(function(b) {
  5. var imageBand = image.select(ee.String(b));
  6. // 在这里,将属性 "system:time_start "与乐队的时间戳(以毫秒为单位)进行设置。
  7. // ee.Date.millis()这里或许能用的上在设置影像时间上
  8. return imageBand.copyProperties(image, ['system:time_start']);
  9. });
  10. var ic = ee.ImageCollection.fromImages(imageBandsAsList);
  11. print(ic);

 

 

 

文章来源: blog.csdn.net,作者:此星光明2021年博客之星云计算Top3,版权归原作者所有,如需转载,请联系作者。

原文链接:blog.csdn.net/qq_31988139/article/details/125398922

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。