Part 12. Batch Management of Personal Assets

Note: If not batch processing, GEE is quite fast.

12.1: Creating a Folder

For legacy assets:

!earthengine create folder users/xxx/folder1

Example:

!earthengine create folder users/M1_GIS/CO2

12.2: Retrieve Image Collection in a Folder

Retrieve the image collection in a folder:

# Get the list of files in the specified folder
files = !earthengine ls projects/m1-gis-project/assets
print(files)

12.3: Batch Delete Files

Batch delete files in a folder col1. rm is used for deletion:

# Get the list of files in the specified folder
files = !earthengine ls users/xxx/col1
# Iterate through the list and delete each file
for file in files:
    print('Deleting', file)
    !earthengine rm $file

12.4: Delete Folder

Delete the root folder:

!earthengine rm users/xxx/col1

12.5: Move Files

Move files. Replace old_file and new_file with actual file names:

!earthengine mv users/xxx/old_file users/xxx/dir2/new_file

12.6: Batch Cancel All Current Tasks

!earthengine task cancel all

Last updated