-1

When exporting from GEE this error is being given "Unexpected arguments to function toDrive(): fileformat" The code is as follows https://code.earthengine.google.com/b80da3ce9d776e3207121b6281b3d780

function mask2clouds (image) {
  var qa = image.select('QA60')
  var cloudBitMask = 1 << 10;
  var cirrusBitMask = 1 << 11;
  
  var mask = qa.bitwiseAnd(cloudBitMask).eq(0)
            .and(qa.bitwiseAnd(cirrusBitMask).eq(0));

  return image.updateMask(mask).divide(10000)
}
var s2 = S2.filterBounds(table)
        .filterDate('2021-01-01', '2022-01-01')
        .filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 1))
        .map( mask2clouds)
        .select(['B4', 'B3', 'B2'])
        .median()
        .clip(table)
print(s2)
var visualization = {
  min: 0.0,
  max: 0.3,
  bands: ['B4', 'B3', 'B2'],
}
  

  var clip= s2.clip(table)
print(clip)
Map.addLayer(clip, visualization, 'RGB');
Map.centerObject(table,10);

Export.image.toDrive({
image:clip,
description: 'HC_S2_20',
fileformat: 'GeoTIFF',
scale: 10,
region: table
})
1
  • I just leave out the fileformat line entirely. As in: ...description: 'HC_S2_20', scale: 10,...
    – John Polo
    Dec 1, 2022 at 3:11

1 Answer 1

1

The property name is fileFormat, not fileformat. See the docs. Replace that and it should work. Your assets aren't shared, so I cannot check if there's something else wrong.

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.