请问各位使用过gee遥感处理平台的朋友,请教个问题。如何在一个js脚本中引用来自另一个js脚本中的结果。比如我有一个脚本如下,生成了一个spei24_roi的图像。spei24_roi已经运行出来了,并且保存到我的Google drive中。
// Retrieve the last date from the SPEI dataset.
var dataset = ee.ImageCollection("CSIC/SPEI/2_8").filterDate('2021-12-01', '2022-01-01');
// Select the 24-month analysis.
var spei24 = dataset.select('SPEI_24_month');
// Define the region of interest (e.g., Spain).
var roi = ee.Geometry.Polygon(
[[[-9.39, 35.85], [-9.39, 43.87], [3.41, 43.87], [3.41, 35.85]]]
);
// Clip the image data to the region of interest.
var spei24_roi = spei24.mean().clip(roi);
// Set the visualization parameters.
var visParams = {
min: -2.33,
max: 2.33,
palette: [
'8b1a1a', 'de2929', 'f3641d',
'fdc404', '9afa94', '03f2fd',
'12adf3', '1771de', '00008b',
]
};
// Add the clipped image layer to the map.
Map.addLayer(spei24_roi, visParams, 'SPEI 24 month - ROI');
// Save the clipped image to your account.
Export.image.toDrive({
image: spei24_roi,
description: 'spei24_roi',
scale: 1000,
region: roi,
maxPixels: 1e9
});
接下来,我想在另一个脚本中使用这个spei24_roi图像,我的代码老提示:
Negative SPEI 24 month - ROI: Layer error: Image.load: Image asset ‘users/xxx/t626/test2.js’ not found。这个脚本引用上面的spei24_roi的图像的语句是:
var spei24_roi_path = 'users/tuyongkai1996yy/t626/test2.js';
var spei24_roi = ee.Image(spei24_roi_path);
谢谢