Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
giswqs
GitHub Repository: giswqs/geemap
Path: blob/master/docs/notebooks/00_ee_auth_colab.ipynb
2313 views
Kernel: Python 3

Open in Colab

Earth Engine Automatic Authentication on Google Colab

Step 1: Locating the Earth Engine Token

  1. Locate the Earth Engine token on your computer by navigating to the following file path based on your operating system:

    • Windows: C:\Users\USERNAME\.config\earthengine\credentials

    • Linux: /home/USERNAME/.config/earthengine/credentials

    • MacOS: /Users/USERNAME/.config/earthengine/credentials

  2. Open the credentials file and copy the entire content to the clipboard.

    Note: Ensure that you do not share the content of the credentials file with others to prevent unauthorized access to your Earth Engine account.

Step 2: Creating the Secret in Google Colab

  1. Open your Google Colab notebook and click on the secrets tab.

  2. Create a new secret with the name EARTHENGINE_TOKEN.

  3. Paste the content from the clipboard into the Value input box of the created secret.

  4. Toggle the button on the left to allow notebook access to the secret.

Step 3: Installing the Required Version of geemap

Ensure that you have installed geemap version 0.29.3 or later, as only these versions support the automatic authentication feature.

%pip install -U geemap

Step 4: Automatic Authentication with geemap

To automatically authenticate Earth Engine using the EARTHENGINE_TOKEN in your Google Colab notebook, run the following code:

import geemap
m = geemap.Map() m