You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GEE反照率时间序列图表生成失败:system:time_start有效值缺失求助

问题根源

报错"No features contain non-null values of 'system:time_start'"的核心原因:你用dataset.mean()把整个影像集合合并成了单张均值合成影像,但ui.Chart.image.series函数需要的是带时间戳(system:time_start)的影像集合——单张影像没有时间序列元数据,自然无法生成时序图表。

修复代码

直接用你已经提取好反照率波段的myAlbedo影像集合生成图表即可,无需提前做均值合成。另外注意你原代码遗漏了startDate的定义,必须补上:

// 补充起始日期,可根据需求调整
var startDate = '2023-01-01'; 
var endDate = '2023-07-16'

var albedo = function(image) {
var alb = image.expression(
"((0.356*blue)+(0.130*red)+(0.373*nir)+(0.085*swir)+(0.072*swir2) - 0.018)/ 1.016",
{
'red': image.select('B4'),
'blue': image.select('B2'),
'nir': image.select('B8'),
'swir': image.select('B11'),
'swir2': image.select('B12')
});
return(image.addBands(alb.rename("albedo")));
};


var dataset = ee.ImageCollection("COPERNICUS/S2_SR")
.filterDate(startDate, endDate)
.filterBounds(roi)
.map(albedo);

print ("dataset", dataset);

var myAlbedo = dataset.select("albedo"); 
print("myAlbedo", myAlbedo); 

// 直接用myAlbedo影像集合生成时序图表
var chart2 = ui.Chart.image.series({
  imageCollection: myAlbedo,
  region: roi,
  reducer: ee.Reducer.mean(), // 用均值统计区域反照率比first()更合理
  scale: 30,
}).setOptions({title: 'Série Temporal Albedo'});

print(chart2);
额外提示
  • 如果需要做时间聚合(比如按月份生成均值时序),可以用ee.ImageCollection.map结合时间分组,或用reduceColumns处理,确保每个聚合结果保留对应时间属性。
  • 原代码用ee.Reducer.first()统计区域值参考性弱,换成mean()能更准确反映ROI内的平均反照率。

内容的提问来源于stack exchange,提问作者Alexandre Messias Reis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 02:05:24