0

I want to export a time series of data from imagecollection in GEE. I tried to use map() to visualize and export. I successfully visualized them but failed to export them. I got Error: Exported bands must have compatible data types; found inconsistent types: Float32 and UInt16. (Error code: 3). Does anyone knows what's wrong with the code and how to export imagecollection?

Here is my code.

// collect data

SEL_BANDS = ['green','red','blue','nir']

var Landsat = ee.ImageCollection(ee.ImageCollection('LANDSAT/LT4_L1T_TOA').select(L45_BANDS, STD_NAMES).map(function(img){return img.set('sensor','L4')})
  .merge(ee.ImageCollection('LANDSAT/LT5_L1T_TOA').select(L45_BANDS, STD_NAMES).map(function(img){return img.set('sensor','L5')})
  .merge(ee.ImageCollection('LANDSAT/LC8_L1T_TOA').select(L8_BANDS, STD_NAMES).map(function(img){return img.set('sensor','L8')}))))
  .filterMetadata("CLOUD_COVER", "less_than", cloud)
  .filter(ee.Filter.dayOfYear(start,end))
  .filterBounds(catchment)
  .select(SEL_BANDS)
  .filterDate(startY, endY) 
  .map(function(img) {return img.clip(catchment)});

//visualize and export

function addImage(image) {
  var id = image.id
  var image = ee.Image(image.id)
  var image_c = image.clip(catchment)
  Map.addLayer(image_c)
  Export.image.toDrive({image_c: image, folder: "Folder", region: catchment, scale: 100, maxPixels: 400000000});
}

Landsat.evaluate(function(Landsat) {Landsat.features.map(addImage)
})
Ryan M
  • 18,333
  • 31
  • 67
  • 74
Zijie Chai
  • 1
  • 1
  • 1

1 Answers1

0

You can only export one image with your function. Try this:

Exporting all images in a Google Earth Engine image collection (Google Earth Engine API)

//image Collection Download

var batch = require('users/fitoprincipe/geetools:batch')
  
  batch.Download.ImageCollection.toDrive(YourCollection, 'test', {
  scale: 30,
  region: YourRegion
})
Yash Karanke
  • 764
  • 1
  • 15
  • 29
Peter
  • 1