javascript - 谷歌地球引擎:点值提取错误
问题描述
我正在尝试提取一组位置的降雨量 (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。
解决方案
您的代码的问题是您在所有月份都使用 2018 年和 2019 年。在您选择的一段时间内,没有数据,因此您的月度价值是返回 0 个波段的图像。由于您的图像没有带,reducer 找不到任何信息,因此它返回 crs not found。我只需将年份更改为从 2017 年开始到 2018 年结束即可成功运行您的代码。
推荐阅读
- scala - 使用 Spark Scala 检查一个数据框列中的值是否存在于另一个数据框列中
- terraform - 如何在 Terraform 模板文件变量中使用 Bash 命令?
- java - 当我在另一个应用程序中键入时,我的 Java 程序没有发出声音
- excel - 如何取消查找/替换提示的对话框?
- javascript - 有没有办法在没有实例的情况下获取 css 类的值?
- android - 如果我的应用程序被选为默认拨号器应用程序。是否可以有意在拨号器中显示呼叫
- node.js - 如何使用 NodeJS 编写大型随机二进制文件
- micronaut - 如何获取 JSR-330 注释的外部类的注入实例
- python - 使用元素组作为标题的旧数据框
- php - 使用 PHP 调用要在表格中显示的数组