0

从 GEE 批量下载栅格时

我想过年,这在功能的属性中

光栅

以便它可以动态命名输出而不是数字 ID,即名称应该是Level_2_Monthly_NDVI_LANDSAT_September_2017而不是Level_2_Monthly_NDVI_LANDSAT_September_1.

在此处输入图像描述

var colList = all_out_raster_tiles.toList(all_out_raster_tiles.size());
print("All tiles Collection List ", colList)
var n = colList.size().getInfo();
print("No of tiles in Collection", n)

for (var i = 0; i < n; i++) {
      
      var img = ee.Image(colList.get(i));
      var id = img.id().getInfo();
      var listOfImages = all_out_raster_tiles.toList(all_out_raster_tiles.size());
      var Tile = listOfImages.get(i);
      var allRasters = ee.ImageCollection.fromImages([Tile]);
      print("Raster no " + i, allRasters)
      //var year_name = ee.Number.parse(allRasters.get('year'));
      //print(year_name);

      batch.Download.ImageCollection.toDrive(allRasters, "USAKA_LANDSAT8_NDVI", 
      {name: 'Level_2_Monthly_NDVI_LANDSAT_September_'+id,
      scale: 30,
      region: roi
      })
}
Raster no 2
ImageCollection (1 element)
type: ImageCollection
bands: []
features: List (1 element)
0: Image (1 band)
type: Image
bands: List (1 element)
0: "NDVI", float ∈ [-1, 1], EPSG:4326
properties: Object (4 properties)
month: 9
system:index: 2
system:time_start: 1504224000000
year: 2017

怎么做?

4

0 回答 0