Lab GEE 1
Lab GEE 1
• Once registered you can access the Earth Engine environment here:
https://code.earthengine.google.com
Objective
The objective of this lab is to give you an introduction to the Google
Earth Engine processing environment. By the end of this exercise you
will be able to search, find and visualize a broad range of remotely
sensed datasets. We will start with single-band imagery - elevation data
from the SRTM mission.
The Earth Engine code editor
The Earth Engine code editor
1. Editor Panel 2. Right Panel 3. Left Panel
The Editor Panel is where you Console tab for printing output. Scripts tab for managing your
write and edit your Javascript code Inspector tab for querying map programming scripts.
results. Docs tab for accessing
Tasks tab for managing long documentation of Earth Engine
running tasks. objects and methods, as well as a
few specific to the Code Editor
application
Assets tab for managing assets
that you upload.
4. Interactive Map 5. Search Bar 6. Help Menu
For visualizing map layer output For finding datasets and places of User guide reference
interest documentation
Help forum Google group for
discussing Earth Engine
Getting started with images
Navigate to Beirut and zoom in using the mouse wheel.
• Clear the script workspace by selecting "Clear script" from the Reset
button dropdown menu.
• Search for “elevation” and click on the SRTM Digital Elevation Data
30m result to show the dataset description.
• View the information on the dataset, and then click on Import, which
moves the variable to the Imports section at the top of your script.
• Rename the default variable name "image" to be "srtm".
• Add the image object to the console by coping the script below into
the code editor, and click "run" :
print(srtm);
• Browse through the information that was printed to the console. Open the
“bands” section to show the one band named “elevation”. Note that all
this same information is automatically available for all variables in the
Imports section.
• Use the Map.addLayer() method to add the image to the interactive map. We will
start simple, without using any of the optional parameters.
Map.addLayer(srtm);
Adjusting visualisation parameters
• The displayed map will look pretty flat grey, because the default
visualization parameters map the full 16bit range of the data onto the
black–white range, but the elevation range is much smaller than that in any
particular location.
• Select the Inspector tab. Then click on a few points on the map to get a feel
for the elevation range in this area.
// Add the data again, but with rescrited value ranges for better visualisation
Map.addLayer(srtm, {min: 0, max: 300})
// Add the data again, with value ranges, and a useful title for teh Layer tab
Map.addLayer(srtm, {min: 0, max: 300}, 'Elevation above sea level');
• The next step is then to save you script by clicking "Save". It will be saved
in your private repository, and will be accessible the next time you log in
to Earth Engine.
• If you would like to experiment with different colour combinations, you can
play with colour palettes as per the example below: