2

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 ?

2

1 Answer 1

2

As mentionned by Daniel Wiell, an extensible list can be found in the api core code:

/**
 * The types of assets. Note that the server describes table assets as
 * feature collections, though they should be described to users as tables.
 * @enum {string}
 */
ee.data.AssetType = {
  ALGORITHM: 'Algorithm',
  FOLDER: 'Folder',
  FEATURE_COLLECTION: 'FeatureCollection',
  IMAGE: 'Image',
  IMAGE_COLLECTION: 'ImageCollection',
  TABLE: 'Table',
  UNKNOWN: 'Unknown'
};

The one you'll get in the Python API are the keys of the previous table

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.