Getting started overview
Getting started with Google Earth Engine involves a set of initial steps to gain access to the platform's computational capabilities and extensive geospatial data catalog. This process primarily includes requesting access, setting up your development environment, and authenticating your applications. Google Earth Engine supports both a JavaScript API for interactive development within the Code Editor and a Python API for integrating Earth Engine into larger scripts or workflows Google Earth Engine getting started guide.
The platform is designed for large-scale analysis of satellite imagery and other geospatial data, with its primary applications spanning environmental monitoring, climate change research, and various geospatial data science tasks Google Earth Engine homepage. Commercial use of Earth Engine is integrated with Google Cloud pricing for compute and storage Google Cloud Earth Engine pricing summary, while academic and research (non-commercial) use is available for free.
The following table provides a quick reference for the essential steps to begin using Google Earth Engine:
| Step | What to do | Where |
|---|---|---|
| 1. Request Access | Complete the sign-up form for an Earth Engine account. | Earth Engine sign-up page |
| 2. Install SDK (Python) | Install the earthengine-api library via pip. |
Python environment (e.g., Anaconda, virtualenv) |
| 3. Authenticate | Run the authentication command for Python or log into the Code Editor. | Terminal (Python) or Earth Engine Code Editor |
| 4. Write Code | Develop a simple script to load and display data. | Earth Engine Code Editor or Python IDE |
| 5. Run & Verify | Execute the script and confirm data visualization or output. | Code Editor console/map or Python script output |
Create an account and get keys
To begin using Google Earth Engine, you must first request access. The platform operates on an approval basis, particularly for its non-commercial free tier. For commercial applications, access is managed through Google Cloud projects Google Cloud Earth Engine integration.
Requesting Non-Commercial Access
- Navigate to the Sign-up Page: Go to the official Earth Engine sign-up page.
- Complete the Form: Fill out the registration form, providing details about your intended use case. This typically includes information about your project, affiliation (e.g., academic, research), and a brief description of how you plan to utilize Earth Engine.
- Await Approval: Google reviews sign-up requests. Approval times can vary, but you will receive an email notification once your account is activated.
- Accept Terms of Service: Upon initial login to the Earth Engine Code Editor, you will be prompted to accept the Google Earth Engine Terms of Service.
Commercial Access (Google Cloud Earth Engine)
For commercial use, Google Earth Engine is integrated into Google Cloud. This requires:
- Google Cloud Project: You need an active Google Cloud Project. If you don't have one, create a new project via the Google Cloud Console.
- Enable Earth Engine API: Within your Google Cloud Project, navigate to the APIs & Services Dashboard and enable the Earth Engine API Google Cloud Earth Engine setup.
- Billing Setup: Ensure billing is enabled for your Google Cloud Project. Commercial Earth Engine usage incurs charges according to Google Cloud pricing for compute and storage.
- Authentication: Authentication for commercial use typically leverages Google Cloud service accounts or user accounts with appropriate IAM roles (e.g., Earth Engine User role) Google Cloud authentication guide. API keys are generally not used for direct Earth Engine API access; instead, OAuth 2.0 or service account keys are employed.
Your first request
After your account is approved and set up, you can make your first request using either the JavaScript API in the Code Editor or the Python API.
JavaScript API (Earth Engine Code Editor)
The Earth Engine Code Editor is an interactive web-based IDE specifically designed for JavaScript-based Earth Engine development. It offers a map interface to visualize results, a console for output, and a script manager.
- Open the Code Editor: Navigate to code.earthengine.google.com. Log in with the Google account you used to sign up.
- Create a New Script: In the 'Scripts' panel on the left, click 'New script'.
- Add Simple Code: Paste the following JavaScript code into the new script window. This example loads a LandSat 8 image collection, filters it, takes the median, and adds it to the map.
// Load a Landsat 8 TOA image collection.
var imageCollection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR')
.filterDate('2018-01-01', '2019-01-01')
.filterBounds(ee.Geometry.Point(-122.2, 37.8));
// Take the median of the collection.
var medianImage = imageCollection.median();
// Define visualization parameters.
var visParams = {
bands: ['B4', 'B3', 'B2'],
min: 0,
max: 3000,
gamma: 1.4
};
// Add the image to the map.
Map.addLayer(medianImage, visParams, 'Median Landsat 8 Image');
Map.centerObject(medianImage, 10);
- Run the Script: Click the 'Run' button (triangle icon) at the top of the Code Editor. You should see the median LandSat 8 image displayed on the map, centered on the specified coordinates. The 'Console' tab will show any print statements or errors.
Python API
The Python API allows for more advanced scripting, integration with other Python libraries, and execution in local environments or cloud computing platforms.
- Install the Earth Engine Python Client Library: Open your terminal or command prompt and install the library using pip:
pip install earthengine-api
- Authenticate Your Python Environment: You need to authenticate your Python environment to access Earth Engine. Run the following command in your terminal:
earthengine authenticate
This command will open a web browser, prompting you to log in with your Google account. Grant the necessary permissions, and a token will be returned to your local environment. If you're using a headless server, follow the instructions for obtaining a token manually Earth Engine Python installation guide.
- Write a Simple Python Script: Create a new Python file (e.g.,
first_ee_script.py) and add the following code:
import ee
# Initialize the Earth Engine API.
ee.Initialize()
# Load a Landsat 8 TOA image collection.
image_collection = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR') \
.filterDate('2018-01-01', '2019-01-01') \
.filterBounds(ee.Geometry.Point(-122.2, 37.8))
# Take the median of the collection.
median_image = image_collection.median()
# Print information about the image.
print('Median image projection:', median_image.projection().getInfo())
print('Median image band names:', median_image.bandNames().getInfo())
# You can also export the image to Google Drive or Cloud Storage.
# For example, to export to Google Drive (requires Drive API enabled):
# task = ee.batch.Export.image.toDrive(
# image=median_image,
# description='median_landsat_image',
# folder='EarthEngineExports',
# scale=30,
# region=ee.Geometry.Point(-122.2, 37.8).buffer(1000).bounds()
# )
# task.start()
# print('Export task started:', task.status().get('state'))
- Run the Script: Execute your Python script from your terminal:
python first_ee_script.py
The script will print information about the median Landsat 8 image to your console. While the Python API doesn't have a direct built-in map viewer like the Code Editor, you can integrate it with libraries like folium or ipyleaflet for visualization in Jupyter notebooks Earth Engine image visualization guide, or export results for external mapping applications.
Common next steps
Once you've successfully made your first request, consider these common next steps to deepen your understanding and utilization of Google Earth Engine:
- Explore the Data Catalog: Familiarize yourself with the vast Earth Engine Public Data Catalog, which includes satellite imagery (Landsat, Sentinel, MODIS), climate data, geophysical datasets, and more. Understanding available datasets is crucial for effective analysis.
- Learn Earth Engine Concepts: Dive into core concepts like Images, Image Collections, Features, Feature Collections, and Geometries. Understanding these data structures is fundamental to writing complex scripts Earth Engine fundamental concepts.
- Master Filtering and Mapping: Practice filtering data by time, location, and metadata. Learn to apply functions over image collections using
.map()for efficient, parallel processing. - Visualization Techniques: Explore advanced visualization parameters, including band combinations, palettes, and charting, to effectively display your analytical results. The Code Editor's asset management and GUI builder capabilities can enhance interactive exploration.
- Exporting Results: Learn how to export your processed images, tables, or charts to Google Drive, Google Cloud Storage, or other formats for use in GIS software or other applications.
- Advanced Analysis: Investigate machine learning algorithms (e.g., classification, regression), time-series analysis, and change detection techniques available within Earth Engine.
- Join the Community: Engage with the Earth Engine developer community through forums like Stack Exchange Google Earth Engine on Stack Exchange for support and to share knowledge.
Troubleshooting the first call
Encountering issues during your initial setup or first request is common. Here are some troubleshooting tips for the most frequent problems:
- Account Access Pending: If your account is not yet approved, you will receive an error indicating insufficient permissions. Check your email for an approval notification. If it's been more than a few days, you can contact Earth Engine support Earth Engine support options.
- Authentication Errors (Python):
- Token Expired/Invalid: Rerun
earthengine authenticateto refresh your credentials. - Permissions Denied: Ensure you granted all necessary permissions during the authentication process. If reusing a Google Cloud Project, verify that the Earth Engine API is enabled and your service account or user has the correct IAM roles.
ee.Initialize()not called: Always ensureee.Initialize()is called at the beginning of your Python script after importingee.
- Token Expired/Invalid: Rerun
- Code Editor Script Not Running/Displaying:
- Syntax Errors: Check the 'Console' tab for syntax errors. The Code Editor often highlights errors directly in the script.
- Map Layers Not Visible: Ensure
Map.addLayer()is called, and the visualization parameters (min,max,bands) are appropriate for the data. Also, verify thatMap.centerObject()orMap.setCenter()is used to zoom to the relevant area. - Invalid Asset ID: If you are loading a specific asset (e.g.,
ee.Image('users/your_asset_path/image_name')), double-check that the asset ID is correct and that you have access permissions.
- Data Filtering Issues:
- No Images Found: If a filter (e.g.,
filterDate,filterBounds) results in an empty collection, expand your date range or geographic bounds. Verify the coordinates of youree.Geometry.Pointor other geometry. - Incorrect Band Names: Ensure you are using the correct band names for the specific image collection you are working with, as these can vary between datasets. Refer to the Earth Engine Data Catalog for band information.
- No Images Found: If a filter (e.g.,
- Google Cloud Project (Commercial Use): Verify that the Earth Engine API is enabled in your Google Cloud Project and that billing is correctly set up. Insufficient quotas or disabled APIs can prevent requests from succeeding.