-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
246c33c
commit 17a9dbd
Showing
5 changed files
with
92 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""Earth Engine utilities.""" | ||
|
||
import logging | ||
|
||
import ee | ||
|
||
# geemap is not used yet | ||
# import geemap | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def init_ee(project: str): | ||
"""Initialize Earth Engine. Authenticate if necessary. | ||
Args: | ||
project (str): The project name. | ||
""" | ||
logger.debug("Initializing Earth Engine") | ||
try: | ||
ee.Initialize(project=project) | ||
# geemap.ee_initialize(project=project, opt_url="https://earthengine-highvolume.googleapis.com") | ||
except Exception: | ||
logger.debug("Initializing Earth Engine failed, trying to authenticate before") | ||
ee.Authenticate() | ||
ee.Initialize(project=project) | ||
# geemap.ee_initialize(project=project, opt_url="https://earthengine-highvolume.googleapis.com") | ||
logger.debug("Earth Engine initialized") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters