0% found this document useful (0 votes)
18 views20 pages

Lab GEE 1

This document provides a guide for getting started with Google Earth Engine, including registration, accessing the code editor, and visualizing remotely sensed datasets. It covers the steps to import elevation data from the SRTM mission, adjust visualization parameters, and save scripts. Additionally, it introduces hillshading and slope visualization techniques for enhanced data representation.

Uploaded by

fadi.shamtia21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views20 pages

Lab GEE 1

This document provides a guide for getting started with Google Earth Engine, including registration, accessing the code editor, and visualizing remotely sensed datasets. It covers the steps to import elevation data from the SRTM mission, adjust visualization parameters, and save scripts. Additionally, it introduces hillshading and slope visualization techniques for enhanced data representation.

Uploaded by

fadi.shamtia21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Lab 1 - Getting started with

Google Earth Engine


Ghaleb Faour
Registration
• Completion of this lab exercise requires use of the Google Chrome
browser and a Google Earth Engine account. If you have not yet
signed up - please do so now in a new tab:

• Earth Engine account registration :


https://earthengine.google.com/new_signup/

• 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.

• Now you can set some more appropriate visualization parameters by


adjusting the code as follows (units are in meters above sea level):

Map.addLayer(srtm, {min: 0, max: 300});


• You will now be able to see variation in elevation range with low values in
black and highest points in white. Layers added to the map will have default
names like "Layer 1", "Layer 2", etc. To improve the readability, we can give
each layer a human-readable name, by adding a title with the syntax in the
following code. Don't forget to click run.

Map.addLayer(srtm, {min: 0, max: 300}, 'Elevation above sea level');


Commenting and saving your scripts
Now the last step for today is to save your code, however before doing that
it is good practice to add a some comment lines to your code reminding you
of what you did and why. We add these with two forward slashes // :
// Print data details to console
print(srtm);

// Add the SRTM data to the interactive map


Map.addLayer(srtm)

// 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:

Map.addLayer(srtm, {min: 0, max: 300, palette: ['blue', 'yellow', 'red']},


'Elevation above sea level');
Hillshading and slope

• For better visualisation we can create a hillshade view of the elevation


data. Remember you can use the Layer transparency options to create
draped images for colourised hillshades.

var hillshade = ee.Terrain.hillshade(srtm);


Map.addLayer(hillshade, {min: 150, max:255}, 'Hillshade');

• Slope works in a similar way:

var slope = ee.Terrain.slope(srtm);


Map.addLayer(slope, {min: 0, max: 20}, 'Slope');

You might also like