toAsset#

static geetools.ee_export.ExportAccessor.imagecollection.toAsset(imagecollection, index_property='system:id', description='', assetId='', **kwargs)#

Creates a task to export an EE ImageCollection to an EE Asset.

The method will create the imagecollection asset beforehand and launching the task will Populate the said image collection with the exported images. Each image in the Collection Will be named using the index_property value of the image. If no asset Id is provided the asset will be created at the root of the current project assets.

Parameters:
  • imagecollection (ee.ImageCollection) – The image collection to export.

  • index_property (str) – The property of the image to use as name. Default is "system:id".

  • description (str) – The description of the task.

  • assetId (str) – The asset id where to export the image collection.

  • **kwargs – every parameter that you would use for a vanilla ee.batch.Export.image.toAsset()

Returns:

The task created.

Return type:

list[ee.batch.Task]

Examples

import ee
import geetools

ee.Initialize()

# create a test image collection
collection = ee.ImageCollection("COPERNICUS/S2").limit(5)

# export the collection
tasks = ee.batch.Export.geetools.imagecollection.toAsset(collection, "system:index", "test export")