gee-community / ee-runner

Command-line runner for Google Earth Engine Playground scripts
Apache License 2.0
67 stars 18 forks source link

Export to GCS for multiband images #35

Open tillmann123456 opened 3 years ago

tillmann123456 commented 3 years ago

Hi, I'd like to automate uploading of multiband image assets from GEE into GCS. The band name contains important information on the date of capture, so I need to keep it. Is this possible?

For now, my efforts have only led to that for every image I upload into GCS, there get generated dozens of separate .tif files, possibly one for each band, but the naming is not clear. Great if you could give me any advice on this! My code is below, where "t" and "loc" are assigned during a loop.

Thanks a lot, Tillmann

var params = {
  element:load,
  type:'EXPORT_IMAGE',
  description: loc+"_demeaned_Y"+t+"of7",
  region: load.geometry(),
  outputPrefix: loc+"_demeaned_Y"+t+"of7",
  outputBucket: "XXX",
  scale: 3.1,
  fileFormat: "GEO_TIFF", 
  formatOptions: {
    cloudOptimized: true

}

}
var taskId = ee.data.newTaskId(1)

ee.data.startProcessing(taskId, params);
gena commented 3 years ago

I'd probably post this question on https://groups.google.com/forum/#!forum/google-earth-engine-developers since it addresses EE functionality (https://developers.google.com/earth-engine/guides/exporting#to-cloud-storage).

Does renaming bands in a multi-band image work? I thought it should turn band names into file names for a multi-band image.

An alternative is maybe to generate a set of bounding box features with all required properties (time, etc.) in addition to images, with unique image ids.