Google Earth Engine – Downloading Pixels for “1 < BurnDate < 366" from MODIS Burned Area

downloadgoogle-earth-enginegoogle-earth-engine-javascript-apimodis

The following code downloads 3 band burned area rasters for each month in the defined range.

I am only interested in the pixels in the 'BurnDate' band, which have values between 1 and 366.

I wish to download all pixels in the defined range, which meet these conditions, as a single raster. This could be reclassified so that 1 = within range, 0 = nodata.

    var batch = require('users/fitoprincipe/geetools:batch')
    
    var dataset = ee.ImageCollection('MODIS/006/MCD64A1')
                      .filter(ee.Filter.date('2000-01-01', '2001-01-01'))
                      .select(['BurnDate']);
    // Select "1 < BurnDate < 366" here
 
    
    batch.Download.ImageCollection.toDrive(dataset, '1899', 
          {region: geometry, // use a polygon
           scale: 500,
           fileFormat: 'GeoTIFF',
           crs: 'EPSG:4326'
          })

Best Answer

You can use ee.ImageCollection.toBands() to convert each image in an image collection to a band in a multiband image. Then just export that single multiband image.

burnedArea = burnedArea.toBands();
Export.image.toDrive({
  image: burnedArea ,
  description: 'BurnedImage_multiband',
  folder: 'FOLDER',
  region: geometry,
  scale: 500,
  fileFormat: 'GeoTIFF',
  crs: 'EPSG:4326'
});
Related Question