我收到此错误:生成图表时出错:轴 # 0 的数据列不能是字符串类型

问题描述

我收到此错误生成图表时出错:轴#0 的数据列不能是字符串类型。我想获取 2005 年到 2014 年的每日温度数据。

这是代码

    // Get  temperature data for 1 year.
var POI = /* color: #d63000 */ee.Geometry.Point([-47.3888888,-20.5888888]);
var modis = ee.ImageCollection('MOdis/006/MOD11A1');
var modisLST = modis.filterBounds(POI)
                    .filterDate('2000-12-25','2001-02-25')
                    .select('LST_Day_1km');


// Convert temperature to Celsius.
modisLST = modisLST.map(function(img){
  var date = img.get('system:time_start');
  return img.multiply(0.02).subtract(273.15).set('system_time_start',date);
});

// Create a function that takes an image,calculates the mean over a
// geometry and returns the value and the corresponding date as a 
// feature.
var createTS = function(img){
  var date = img.get('system_time_start');
  var value = img.reduceRegion(ee.Reducer.mean(),POI).get('LST_Day_1km');
  var ft = ee.Feature(null,{'system:time_start': date,'date': ee.Date(date).format('Y/M/d'),'value': value});
  return ft;
};

// Apply the function to each image in modisLST.
var TS = modisLST.map(createTS);

// Create a graph of the time-series.
var graph = ui.Chart.feature.byFeature(TS,'system:time_start','value');

print(graph.setChartType("ColumnChart")
           .setoptions({vAxis: {title: 'LST [deg. C]'},hAxis: {title: 'Date'}}));

// Export the time-series as a csv.
Export.table.toDrive({collection: TS,selectors: 'date,value'});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...