3

I clipped Nighttime image VIIRS-DNB according to my area of interest from Google Earth Engine. But I am unable to export it because of showing error.

Error: Image.clipToBoundsAndScale, argument 'input': Invalid type. 
Expected type: Image. Actual type: ImageCollection. (Error code: 3).

What do I have to do?

var table2 = ee.FeatureCollection("projects/tensile-axiom-380702/assets/bangladeshh"),
    imageCollection = ee.ImageCollection("NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG");
Map.addLayer(table2)

var dataset = ee.ImageCollection('NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG')
                  .filter(ee.Filter.date('2018-12-01', '2018-12-31'))
                  .filterBounds(table2);
    
function clp(img)   {
  return img.clip(table2)
}

var clippedVIIRS = dataset.map(clp)
var nighttime = clippedVIIRS.select('avg_rad');
Map.addLayer(nighttime.median());

Export.image.toDrive({
  image: nighttime,
  description: 'banlll',
  fileFormat: 'GeoTIFF',
  region: table2,
  scale: 750,
  maxPixels: 1e8
  
})
0

1 Answer 1

5

nighttime is an ImageCollection even if it contains a single image. The error states that clearly.

To get that one image, use nighttime.first().

Export.image.toDrive({
  image: nighttime.first(),
  ...

enter image description here

0

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.