setProperties#

geetools.ee_asset.Asset.setProperties(**kwargs)#

Set properties of the asset.

Parameters:

**kwargs – The properties to set key, value pairs. To name normal properties simply use the name as key. For system properties, prefix it with “system:”. Note that only the “time_start” and “time_end” are editable.

Return type:

ee.Asset

Warning

GEE is not accepting any data type for the time_start and time_end properties. TO simplify usage this method will be accepting datetime.datetime, datetime.date, int (in milliseconds) and str (in ISO format with a “Z” at the end). If any other type is used, it will be converted to a string (and will most likely fail in GEE).

Examples

# dates need to be set in milliseconds
start = dt.datetime(2021, 1, 1).timestamp() * 1000
asset = ee.Asset("projects/ee-geetools/assets/folder/image")
asset.setProperties(**{"description": "new_description", "system:time_start": start})