App Engine Example Apps

The following describes each example in the Earth Engine demos directory on GitHub. The title of each example is a link to the source on GitHub. The screenshots link to the live demos. The examples are organized by how they authenticate with Earth Engine. To learn more about authentication options and how to deploy these applications, see the App Engine & Earth Engine Overview.

Authentication with service accounts

server-auth

assets
Figure 1. Live demo of server-auth at server-auth-dot-ee-demos.appspot.com

To get started, consider this example the 'hello world' of Earth Engine applications on the App Engine platform. The app displays an interactive map with an Earth Engine Image (SRTM elevation). Inspect the config.py file, noting that it needs to be modified with your project's service account credentials. The only Earth Engine specific code is in server.py (two lines!). Note that Earth Engine gets a mapid for the image to be displayed on the the app's page, then passes this value to the Jinja template used to render the page.


trendy-lights

assets
Figure 2. Live demo of trendy-lights at trendy-lights-dot-ee-demos.appspot.com

This is a more complex example of using server authentication. It adds several polygons to the map, displaying details about the polygons when a user clicks them. It uses the Google Visualization API for charting, and a technique called AJAX to retrieve new data from the server without needing to refresh the page.


Authentication with OAuth2

client-auth

assets
Figure 3. Live demo of client-auth at client-auth-dot-ee-demos.appspot.com

This example demonstrates the OAuth flow for authenticating from the client. Specifically, a user will need to authenticate as themselves (meaning they are already an Earth Engine user) to use the app. To make that work, JavaScript origins and authorized redirects need to be set from the Developers Console.


map-layer

assets
Figure 4. Live demo of map-layer at map-layer-dot-ee-demos.appspot.com

This example also uses the client authorization flow. It demonstrates using ee.MapLayerOverlay to add Earth Engine data to the map with a callback function to keep track how many tiles have been loaded. (All of the mapping functionality in this demo can be done with mapids generated on the server, as is done in the server-auth demo).


polygon-drawing

assets
Figure 5. Live demo of polygon-drawing at polygon-drawing-dot-ee-demos.appspot.com

This example also uses the client authorization flow. The example demonstrates functionality to draw a polygon over the map, perform a reduce region with the polygon in Earth Engine, and display the polygon mean. (All of the mapping functionality in this demo can be done with mapids generated on the server, as is done in the server-auth demo).


export-to-drive

assets
Figure 6. Live demo of export-to-drive at export-to-drive-dot-ee-demos.appspot.com

This is a relatively complex example. It demonstrates the use of two authentication flows, one for Earth Engine using the application's credentials and one for Google Drive using the user's personal credentials. It allows the user to select a layer, draw a polygon and export the layer clipped by the polygon to Drive.

发送以下问题的反馈:

此网页
Google Earth Engine API