实验 2 Google Earth Engine - Image.select 错误
Lab 2 Google Earth Engine - Image.select error
我是编码新手,刚开始使用 Google Earth Engine 代码编辑器。
我在 Google Earth Engine 提供的实验 2:https://docs.google.com/document/d/1NojoqhGbsBnIWE2OSwYCgMmRxeZDn7F1g3kkNuMGJ1E/edit
当完成实用数1.a.v。我得到两个错误。
完整代码见下方:
var myd09 = ee.ImageCollection('MODIS/006/MYD09GA');
// Define a region of interest as a point at SFO airport.
var sfoPoint = ee.Geometry.Point(-122.3774, 37.6194);
// Center the map at that point.
Map.centerObject(sfoPoint, 16);
// Get a surface reflectance image from the MODIS MYD09GA collection.
var modisImage = ee.Image(myd09.filterDate('2011-08-28').first());
// Use these MODIS bands for red, green, blue, respectively.
var modisBands = ['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03'];
// Define visualization parameters for MODIS.
var modisVis = {bands: modisBands, min: 0, max: 3000};
// Add the MODIS image to the map.
Map.addLayer(modisImage, modisVis, 'MODIS');
// Get the scale of the data from the first band's projection:
var modisScale =
modisImage.select('sur_refl_b01').projection().nominalScale();
print('MODIS scale:', modisScale);
我收到的错误是:
1) 数字(错误)
Image.select:需要参数'input'。
2)MODIS:图层错误:资产不是图像或图像集合。
有没有人能帮助我解决问题或为我指明正确的方向!
谢谢,
哈里特·威尔逊
是的,如果您打印图像(以查看其信息),例如:
print(modisImage)
你会看到它是 null,所以我打印出 collection:
print(myd09)
发现collection开始于2016年,所以只需更改过滤器日期:
var modisImage = ee.Image(myd09.filterDate('2016-08-11').first());
错误原因是因为MODIS collection 6 (MYD09.006) has not been completely ingested (but will be). For the purposes of this lab, you can either use a more recent image from collection 6 (as suggested previously), or use the older collection 5 (MYD09.005)。我修改了代码实验室以明确这一点。
我是编码新手,刚开始使用 Google Earth Engine 代码编辑器。 我在 Google Earth Engine 提供的实验 2:https://docs.google.com/document/d/1NojoqhGbsBnIWE2OSwYCgMmRxeZDn7F1g3kkNuMGJ1E/edit
当完成实用数1.a.v。我得到两个错误。
完整代码见下方:
var myd09 = ee.ImageCollection('MODIS/006/MYD09GA');
// Define a region of interest as a point at SFO airport.
var sfoPoint = ee.Geometry.Point(-122.3774, 37.6194);
// Center the map at that point.
Map.centerObject(sfoPoint, 16);
// Get a surface reflectance image from the MODIS MYD09GA collection.
var modisImage = ee.Image(myd09.filterDate('2011-08-28').first());
// Use these MODIS bands for red, green, blue, respectively.
var modisBands = ['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03'];
// Define visualization parameters for MODIS.
var modisVis = {bands: modisBands, min: 0, max: 3000};
// Add the MODIS image to the map.
Map.addLayer(modisImage, modisVis, 'MODIS');
// Get the scale of the data from the first band's projection:
var modisScale =
modisImage.select('sur_refl_b01').projection().nominalScale();
print('MODIS scale:', modisScale);
我收到的错误是:
1) 数字(错误) Image.select:需要参数'input'。 2)MODIS:图层错误:资产不是图像或图像集合。
有没有人能帮助我解决问题或为我指明正确的方向!
谢谢, 哈里特·威尔逊
是的,如果您打印图像(以查看其信息),例如:
print(modisImage)
你会看到它是 null,所以我打印出 collection:
print(myd09)
发现collection开始于2016年,所以只需更改过滤器日期:
var modisImage = ee.Image(myd09.filterDate('2016-08-11').first());
错误原因是因为MODIS collection 6 (MYD09.006) has not been completely ingested (but will be). For the purposes of this lab, you can either use a more recent image from collection 6 (as suggested previously), or use the older collection 5 (MYD09.005)。我修改了代码实验室以明确这一点。