I've created a function that retrieve all the GEE assets from a user account:
def get_assets(folder=None, asset_list = []):
# set the folder
folder = folder if folder else ee.data.getAssetRoots()[0]['id']
# loop in the assets
for asset in ee.data.listAssets({'parent': folder})['assets']:
if asset['type'] == 'FOLDER':
asset_list = get_assets(asset['name'], asset_list)
else:
asset_list += [asset]
return asset_list
I use it to get all the asset of a user and then I sort them by type:
assets = get_assets(self.folder)
tables = sorted([e['id'] for e in assets if e['type'] == 'TABLE'])
images = sorted([e['id'] for e in assets if e['type'] == 'IMAGE'])
I recently realise that "IMAGE_COLLECTION" was also a type. So instead of trying to guess I prefer to ask:
What are all the asset types available in GEE ?