I am trying to export all images of the image collection of VIIRS. I am following the answer from this post. Instead of setting a bounding box as a clipping layer I have a .shp
of my study area. When I run the code I am receiving this error:
In users/fitoprincipe/geetools:batch
Line 133: collection.size is not a function
Here is the code:
var batch = require('users/fitoprincipe/geetools:batch');
// Load the VIIRS ImageCollection.
var dataset = ee.ImageCollection('NOAA/VIIRS/DNB/MONTHLY_V1/VCMCFG')
.filterBounds(table)
.select('avg_rad')
.first()
.clip(table);
batch.Download.ImageCollection.toDrive(dataset, 'Folder',
{scale: 460,
region: (table),
type: 'float'})
Why that error? I believe I am following exactly the steps like others did and when I download a single monthly image I do not have any issue.
Best Answer
There is no problem with Principe's code. Here is the solution: