1

I am attempting to detect fires using MODIS thermal anomaly data (MODIS/006/MYD14A1) on Corsica island, and the code I am using below produces a suitable fire mask. I am a bit inexperienced with this, and am unsure what the different pixel colours correspond to (any information relating to pixel colours online is evading me).

Also, when I attempt to export the image to drive I am getting an error message in the Tasks tab: Error: Image.clipToBoundsAndScale, argument 'input': Invalid type. Expected type: Image. Actual type: ImageCollection.

var site = ee.Geometry.Point(9.41, 42.81);
var aoi = ee.Geometry.Rectangle(9.317758730652592, 42.86545558133746, 9.504869631531498, 42.77429487610457);
Map.centerObject(aoi, 11);

// Mid Fire period
var midStart =ee.Date('2017-08-08');
var midEnd =ee.Date('2017-08-24');

//MODIS images of the site, 
var midfireimage = ee.ImageCollection('MODIS/006/MYD14A1')
                    .filterBounds(site)
                    .filterDate(midStart,midEnd);

Map.addLayer(midfireimage, {bands: ['MaxFRP', 'FireMask', 'FireMask'], min:0.0, max:6000}, 'Fire Mask');

Export.image.toDrive({
  image:midfireimage.select('MaxFRP', 'FireMask', 'FireMask'), 
  region:aoi, 
  description: 'MidFire',
  folder: 'Corsica_Fire', 
  scale:30});
1

I assume you picked the map visualization up from the EE catalog example. I find that one a bit strange. Interpreting the colors when visualizing these bands is indeed difficult. I would simply visualize MaxFRP instead.

Your error when exporting is because you are trying to export an ee.ImageCollection. midfireimage is not a single image, but a collection of images. You will want to reduce it into a single image. You have a lot of options on how you want to do that - it all depends on what you want to achieve. Look into the docs for ee.ImageCollection. Methods like min(), max(), median(), mean(), mosaic(), qualityMosaic(), and reduce() will do the trick.

var site = ee.Geometry.Point(9.41, 42.81)
var aoi = ee.Geometry.Rectangle(9.317758730652592, 42.86545558133746, 9.504869631531498, 42.77429487610457)
Map.centerObject(aoi, 11)

// Mid Fire period
var midStart = ee.Date('2017-08-08')
var midEnd = ee.Date('2017-08-24')

//MODIS images of the site, 
var midfireimage = ee.ImageCollection('MODIS/006/MYD14A1')
  .filterBounds(site)
  .filterDate(midStart, midEnd)
  .qualityMosaic('MaxFRP') 

Map.addLayer(midfireimage, {
  bands: ['MaxFRP'], 
  min: 0,
  max: 4000,
  palette: 'yellow, orange, red'
}, 'Fire Mask')

Export.image.toDrive({
  image: midfireimage.select('MaxFRP', 'FireMask', 'FireMask'),
  region: aoi,
  description: 'MidFire',
  folder: 'Corsica_Fire',
  scale: 30
})

https://code.earthengine.google.com/8392d41098c925c27440afdbf87d5092

1
  • Amazing, thank you Daniel!
    – Geographer
    Apr 20 '20 at 13:53

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.