首页 > 解决方案 > 谷歌地球引擎:点值提取错误

问题描述

我正在尝试提取一组位置的降雨量 (CHIRPS) 值,但出现以下错误:

Image.reduceRegions:找不到 crs

其他数据集(例如 terraclimate)不会发生这种情况

当我开始从任务下载表格时出现问题

这是我运行的代码的链接 https://code.earthengine.google.com/c27f2156e81824b0990dcfe0b0a6f455

错误应该在这里:

// do extraction 
var ft = ee.FeatureCollection(ee.List([]));

//Function to extract values from image collection based on point file and export as a table 
var fill = function(img, ini) {
  var inift = ee.FeatureCollection(ini);
  var scale = ee.Image(MM.first()).projection().nominalScale().getInfo()
  var ft2 = img.reduceRegions(pts, ee.Reducer.first(),scale);
  var date = img.date().format("YYYYMM");
  var ft3 = ft2.map(function(f){return f.set("date", date)});
return inift.merge(ft3);
};

// Iterates over the ImageCollection
var profile = ee.FeatureCollection(MM.iterate(fill, ft));

请问你能帮我吗?

谢谢

G。

标签: javascriptgoogle-earth-engine

解决方案


您的代码的问题是您在所有月份都使用 2018 年和 2019 年。在您选择的一段时间内,没有数据,因此您的月度价值是返回 0 个波段的图像。由于您的图像没有带,reducer 找不到任何信息,因此它返回 crs not found。我只需将年份更改为从 2017 年开始到 2018 年结束即可成功运行您的代码。


推荐阅读