示例#1
0
    def __init__(self):

        self.initialize = ee.Initialize()
        self.credentials = ee.Credentials()
        self.service = discovery.build(serviceName='drive',
                                       version='v3',
                                       cache_discovery=False,
                                       credentials=self.credentials)
示例#2
0
def get_credentials():
    credentials = ee.Credentials()
    if type(credentials) == ThreadLocalCredentials:
        credentials = credentials.get()
    if not credentials:
        raise Exception(
            'ee.InitializeThread() has not been called for current thread.')
    return credentials
示例#3
0
文件: export.py 项目: mlateb/sepal
def _first_asset_root():
    asset_roots = ee.data.getAssetRoots()
    if not asset_roots:
        raise Exception('User has no GEE asset roots: {}'.format(
            ee.Credentials()))
    return asset_roots[0]['id']
示例#4
0
def _first_asset_root():
    asset_roots = [bucket['id'] for bucket in ee.data.listBuckets()['assets']]
    if not asset_roots:
        raise Exception('User has no GEE asset roots: {}'.format(
            ee.Credentials()))
    return asset_roots[0]