1

I am exporting a LANDSAT image for Malawi, but the exported image is corrupted, which I really do not understand why.

The link to the Code

https://code.earthengine.google.com/24db16ff4ecc2210f2f2c5e892204247

or here directly, this is my code for exporting the image

Export.image.toDrive({
  image: Malawi,
  description: '10_M',
  scale: 30,
  fileFormat: 'GeoTIFF',
  maxPixels: 120568920794 ,
  folder : '2010_Malawi'
}); 

and my code for constructing the image (just using the RGB bands)

var countries = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw');
var Malawi = countries.filter(ee.Filter.eq('Country', 'Malawi')); 
var landsat = ee.ImageCollection('LANDSAT/LE07/C01/T1_SR');  

var Malawi = landsat
.filterBounds(Malawi)
.filterDate('2010-01-01', '2010-12-31')
.select(['B1', 'B2', 'B3'])
.median(); 
1

From your link, your map view is not in Malawi. And since you are not supplying 'region' with your call to exports, it takes your current map viewport as the region. But since you have clipped your images with the boundary of Malawi, it will find no valid pixels. So you are probably getting image with no pixels which you are referring to as "corrupted" image.

So you have two options, move the map over to your region and make sure the whole region of interest is currently visible on map or supply region with Export

Export.image.toDrive({
  image: Malawi,
  description: '10_M',
  scale: 30,
  fileFormat: 'GeoTIFF',
  maxPixels: 120568920794 ,
  folder : '2010_Malawi',
  region: MalawiBounds //the object with your boundary
});

Also, I'd recommend against naming the boundary and image same and both objects are required to export.

  • Thank you very much, including the region did the job. – Marion Apr 27 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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