You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the project Id is the key to many functionalities of geetools and unfortunately there is an inconsistance in how this information get treated from GEE side itself (see https://issuetracker.google.com/issues/325020447 for more context).
When GEE is Initializedusing a personnal account I can get back the project_id information using the following:
But this operation is not possible using a private key as shown in this example:
importeeimportosimportjsonimporttempfilefrompathlibimportPathimporthttplib2# extract the environment variables dataprivate_key=os.environ["EARTHENGINE_SERVICE_ACCOUNT"]
ee_user=json.loads(private_key)["client_email"]
# connect to GEE using a temp file to avoid writing the key to diskwithtempfile.TemporaryDirectory() astemp_dir:
file=Path(temp_dir) /"private_key.json"file.write_text(private_key)
credentials=ee.ServiceAccountCredentials(ee_user, str(file))
ee.Initialize(credentials=credentials, http_transport=httplib2.Http())
project_id=ee.data._cloud_api_user_project
The extention init method should save this information in a meaningful place
the Asset object shoud be able to rely on it to access current project_id
The text was updated successfully, but these errors were encountered:
the project Id is the key to many functionalities of geetools and unfortunately there is an inconsistance in how this information get treated from GEE side itself (see https://issuetracker.google.com/issues/325020447 for more context).
When GEE is Initializedusing a personnal account I can get back the
project_id
information using the following:But this operation is not possible using a private key as shown in this example:
The text was updated successfully, but these errors were encountered: