Getting Started
This module guides you through setting up your Google Earth Engine (GEE) account and getting started with the platform. It also covers the setup process for integrating GEE with Python, enabling you to leverage its capabilities within Python-based workflows. The process is easier for JavaScript than Python, which requires several additional steps and package installs.
Setting up an Account
Whether you're using the JavaScript or Python API, registering for a Google Earth Engine (GEE) account is the first step here. Registration is tied to your email address. Academic users can sign up for free, and organizational or business accounts are also available, typically set up by the organization's IT department. Approval to use the code editor is automated, although there may be up to a 24-hour delay. Note that regardless of the account type, users must have access to a Google Cloud project to utilize GEE.
When signing up with an organizational or educational email account, there may be restrictions that will have to be handled by the account owner. This guidance may change as GEE's authentication processes evolve.
Once the account is approved and activated, you can access Google Earth Engine and start utilizing its powerful tools for geospatial analysis.
JavaScript
With JavaScript, you can get started immediately - as long as you are logged into the Google account you created your account with, you can access the code editor immediately and begin running scripts. A common issue is when users have multiple Google accounts and the account is incorrect.
Python
Setting up Python takes a little more effort - you have to:
- Install the Earth Engine library (one-time per environment)
- Authenticate your Earth Engine Account (one-time per environment)
- Install dependency libraries (one-time per environment)
- Initiate the API (every time you run a script)
In addition, we will be using the geemap
package for visualization in conjunction with Earth Engine. Installation instructions are included below.
In the terminal, run the following commands - we suggest creating a virtual environment.
pip install earthengine-api --upgrade
pip install geemap
Authenticate Earth Engine
Once the Earth Engine and geemap
libraries are installed, you will need to authenticate your environment. This is theoretically a one-time event, although it might happen more frequently.
In the code chunk below, we import the GEE library and then authenticate. You will be redirected to another page where you will receive a token, which you then enter into the prompt. A pop-up will show; follow the instructions and make sure you are signed into Google with the account associated with GEE.
import ee
ee.Authenticate()
Initiate Earth Engine
Once it is installed, you will have to initiate a session with the API every time you run a script. In the import section of your code, include the following to start using Earth Engine.
# Initialize Earth Engine
import ee
import geemap
ee.Initialize()