0% found this document useful (0 votes)
60 views

GEE - 3 - Coding and Image Visualization

This tutorial teaches how to embed visualization parameters directly into Google Earth Engine scripts so imagery is displayed consistently each time the script is run. It demonstrates mapping bands to RGB colors and stretching ranges for a Landsat composite and digital elevation model. The tutorial shows storing visualization settings like band mappings, value ranges, and color palettes in a dictionary, which is passed as a parameter to the Map.addLayer function. This embeds the parameters to consistently display multi-band composites and single-band images like elevation data the same way each time.

Uploaded by

Geo Spatialist
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

GEE - 3 - Coding and Image Visualization

This tutorial teaches how to embed visualization parameters directly into Google Earth Engine scripts so imagery is displayed consistently each time the script is run. It demonstrates mapping bands to RGB colors and stretching ranges for a Landsat composite and digital elevation model. The tutorial shows storing visualization settings like band mappings, value ranges, and color palettes in a dictionary, which is passed as a parameter to the Map.addLayer function. This embeds the parameters to consistently display multi-band composites and single-band images like elevation data the same way each time.

Uploaded by

Geo Spatialist
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Google Earth Engine Tutorial Pt.

III
Visualization
Zachary Noah and J.B. Sharma, University of North Georgia
Objective:
This tutorial will teach how to use the knowledge of how to visualize images that was taught in
previous tutorials and embed the visualization parameters inside of the GEE script so that the
imagery will appear with the same visualization every time it runs.
Procedure:
In previous tutorials, different ways of visualizing imagery was played with under the layers
settings. This type of visualization has the advantage of being able to easily play with different
types of visualization. However, the visualization settings will reset once the script is rerun. In
order to keep the visualization settings the same each time the script is run, the visualization
parameters can be encoded into the Map.addLayer() function.
1. Go ahead and bring up a LANDSAT image, composite it, and then clip it to the
boundaries of the United States. In order to clip to the United States, follow the same
procedure in the previous tutorial, except do not use the .filterMetadata() function.

2. Examine the parameters used in the Map.addLayer() function. The first parameter is the
image to be displayed. The second parameter is an empty dictionary and the third
parameter is the display name of the layer. The dictionary is where the visualization
parameters will be stored.

1
3. Start by storing the mapping of the bands to the RGB colors in the dictionary.

This instructs the script to map bands 4, 3, and 2 onto the colors red, green, and blue. For
LANDSAT 8 images, this band combination displays the image in true color. Despite this, the
image still looks black and white. This is because the digital numbers have not been
appropriately stretched to be viewed by the human eye.
4. Go to the visualization settings under the layer list and stretch the values to one standard
deviation and click apply.

Much better. This still has the problem of having to be manually applied each time the script is
run. Add the new range to the visualization parameters.

2
Each item in the dictionary contains a key and a value. The key “min” has a value 0.109. The
value can be listed as you see, from the value of the bands key. The visualization of multiband
images has been covered, now the visualization of a single band image will be addressed. A
DEM will be used for visualization of a single band image.
5. Search “terrain” in the data search bar and import “Global Multi-resolution Terrain
Elevation Data”. Now rename the imported variable to terrain and add it to the map
using the Map.addLayer() function.

3
Notice how the mountain ranges of the Western United States can barely be seen and everything
else is uniform gray. This requires the image range to be stretched again.
6. Go to the layers settings for the Terrain layer and stretch the image to 3 standard
deviations. The new range values can now be placed into the visualization parameters
just like with the LANDSAT image.

The color palettes for single band images was briefly played with in the first tutorial, now the
user will learn how to put the palette data as a visualization parameter so the colors remain the
same each time the script is run.
7. First, select some colors using the layers settings menu like you did in the first tutorial.

4
This is a simple 4 color palette. Experimenting with different stretching selections is needed in
order to get the color ramp to display properly. Choose a custom range to tailor the image exactly
to how presentation is preferred.
8. Once the range has been chosen, use those numbers as the min and max parameters
inside of Map.addLayer() function.
In order to add the color palette to script the hex codes of the chosen colors need to be known.
9. Click on the pencil icon at the lower right corner of the layer visualization tool.

10. In the dictionary of visualization parameters create a new entry with the key ‘palette’ and
the value a list of hex codes.

11. Make sure to put each hex code in quotes and to update the min and max values from the
change in stretching.

5
Including all of these visualization parameters directly into the Map.addLayer() causes the script
to become long and unwieldly. For easier reading in the future, the dictionary of the parameters
can be stored as a variable and the variable can be passed as a parameter. See below.

12. Repeat the above activity for another geographic region of your choice and produce a map
composition.

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy