Skip to the content.

QGIS Google Earth Engine plugin

Current Version: 0.0.5 alpha

Use Discussions to leave a comment about the plugin or Issues page to report bugs or new feature requests.

The QGIS Earth Engine plugin integrates Google Earth Engine and QGIS using EE Python API. Currently, the plugin implements only a subset of Map API typically used within the Google Earth Engine Code Editor. To get started - please make sure you’re familiar with the EE first by visiting: https://developers.google.com/earth-engine/getstarted.

Installation

The plugin can be installed from the QGIS Plugin Repository as any other plugin. It may take some time install (~30-60 sec) due to EE dependencies included in the distribution.

The user needs to have an active Google Earth Engine (EE) account to use the plugin. If you don’t have one - please sign-up here: https://earthengine.google.com/signup/.

After the installation, the plugin checks if the user is authenticated to use the EE. If this is not the case - the user will be asked to authenticate.

Once installed and authenticated, the plugin can be accessed from the QGIS Python Code Editor to write and execute EE scripts. There is not UI support available yet, you will have to write code!

To test if the plugin is installed and authenticated properly - type the following in the QGIS Python Console:

>>> import ee
>>> print(ee.String('Hello World from EE!').getInfo())
Hello World from EE!

A more advanced script may look like this:

Add Sentinel-2 image

Map

The plugin implements most of the Map.* functionality typically used in the Code Editor. Note, that no UI or Layers functionality is supported right now.

The following Map functions are currently implemented, optional arguments are in italic:

Check official EE API documentation for Map usage.

Importing plugin

For most of the EE scripts, the following two imports must be included:

import ee
from ee_plugin import Map

After that, the Map.* functions can be used in a similar way to the official EE Code Editor [https://developers.google.com/earth-engine/playground]:

Adding map layers

image = ee.Image('USGS/SRTMGL1_003')
    
Map.addLayer(image, {'palette': ['blue', 'red'], 'min': 0, 'max': 5000}, 'dem', True)

The code above will query Earth Engine for an image and will add it as an XYZ tile layer to the QGIS Canvas.

Note that QGIS projects containing EE map layers can be also saved, in this case, the code required to connect to EE is stored in a QGIS project and is used to re-initialize these layers when the project is loaded. Currently, this works only if ee_plugin is installed in the QGIS where these layers are loaded.

Check examples directory to learn what kind of functionality is currently supported.

FAQ

Q: I am getting authentication errors, what can I do?

A: Try installing the Google Earth Engine command line client. Run the earthengine authenticate command. This resets the authentication credentials and solves most authentication errors.

Q: I am getting error like ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed on MacOS:

A: Open Finder and double clicking on this file /Applications/Python 3.6/Install Certificates.command. This path may vary depending on how QGIS was installed (Homebrew, macports, native). Then restart QGIS.

Q: Plugin crashes after authentication with a stack trace showing 404, what should I do?

A: Go to http://code.earthengine.google.com and make sure you can access code editor. If the plugin is still failing - make sure your IP is not under firewall.

Support Ukraine

Stand With Ukraine

Consider supporting this project:

Donate or just