Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using trying to batch export VIIRS images to Google Drive #13

Open
nikosGeography opened this issue Sep 18, 2022 · 1 comment

Comments

@nikosGeography
Copy link

nikosGeography commented Sep 18, 2022

Hi, I was trying to use batch.ImageCollection.toDrive and I received the error:

In users/fitoprincipe/geetools:batch
Line 133: collection.size is not a function

Here is my 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'})

The table is a shp that I use to clip the ImageCollention. The same error appears when using a bounding box. I created a folder called Folder in my Google Drive.
Here is the link to the GEE project.

@acwatt
Copy link

acwatt commented Nov 7, 2023

@nikosGeography I think the issue is you are trying to export an image, not an image collection. When you use .first(), it selects the first image of the collection, and extracts it from the collection. collection.size only works on collections, not on images, which I believe is why you are getting this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants