0

I'm trying to export an image array produced by the ee.Algorithms.TemporalSegmentation.Ccdc algorithm. This is a 1D image array. I'm trying to export it using:

Export.image.toDrive({
  image: ccdc_tBreak,
  description: 'firstImage',
  crs: "EPSG:4326",
  scale: 30,
  region: Area,
  maxPixels: 1e13,
});

But I obtain the following error:

Error: Cannot export array bands. (Error code: 3)

How can I download the image array or, preferably, convert the 1D image array to a ee.Image() object to download it without problems?

Here my full script: https://code.earthengine.google.com/0d109f15f844c8499bf14c8fdb26b226

1 Answer 1

0

The tBreak band is an array image -- each pixel has one or more values (the length of the array is variable). You could get the first value of each array and export this as an image, or you can use ee.Image.arrayReduce to reduce the array to a single value in each pixel. Here's a demonstration using the first value only. I would recommend going through the documentation of the other ee.Image.array* functions.

var ccdc_img = ee.ImageCollection("GOOGLE/GLOBAL_CCDC/V1")  
  .select('tBreak')
  .filterBounds(Area)
  .first() 
  .clip(Area)
Map.addLayer(ccdc_img, {min:2010, max:2019}, "First image as array.")

var ccdc_img_reduced = ccdc_img.arrayGet([0]) 
//https://developers.google.com/earth-engine/apidocs/ee-image-arrayget

Map.addLayer(ccdc_img_reduced, {min:2010, max:2019}, "First image -- first value only")

Export.image.toDrive({
  image: ccdc_img_reduced,
  description: 'firstimage-export-first-value',
  crs: "EPSG:4326",
  scale: 30,
  region: Area,
  maxPixels: 1e13,
});

https://code.earthengine.google.com/246710700db5706950f1eff48e50e8c4

See also:

Cannot export array bands in Google Earth Engine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.