Monday, 29 February 2016

Google Earth Engine: Export an entire collection


I would like to export all the images that the collection (code) contains. How can I do that?


var colection = ee.ImageCollection ("MODIS/NTSG/MOD16A2/105")


Answer



If you want an automatized process you'll have to use the Python API. If you can do that, follow:



  1. Install geetools (https://github.com/gee-community/gee_tools)



pip install geetools




  1. Export Collection using a python script. As you want to export a MODIS collection, I highly recommend you use a region parameter.



from geetools import batch
import ee
ee.Initialize()

col = ee.ImageCollection("MODIS/NTSG/MOD16A2/105")
region = ee.Geometry.Polygon([XXXX])

help(batch.ImageCollection.toDrive) # See help for function


tasks = batch.ImageCollection.toDrive(col, 'MyFolder', region=region, scale=1000)

Otherwise, if you don't mind clicking "Run" for every image, you can use geetools in the code editor (https://github.com/fitoprincipe/geetools-code-editor), follow:


var tools = require('users/fitoprincipe/geetools:batch')
var col = ee.ImageCollection("MODIS/NTSG/MOD16A2/105")
var region = ee.Geometry.Polygon([XXXX])

batch.ImageCollection.toDrive(col, 'MyFolder',
{region: region,
scale: 1000})

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...