0% found this document useful (0 votes)
120 views7 pages

Google Earth Engine Tutorial Pt. IV: Pixel Selection Zachary Noah and J.B. Sharma, University of North Georgia

This tutorial teaches how to select pixels from raster images using conditional statements and logical operators in Google Earth Engine. It demonstrates selecting pixels from a terrain dataset based on elevation, from a Landsat image based on NDVI values, and combining selections across images. The objectives are to learn pixel selection, select from multiple bands/images, and create a new image with selected pixels. The tutorial uses Landsat 8 and global terrain data, selecting mountain tops, high NDVI values, and combinations of conditions. It concludes by asking students to apply these skills to answer a question using remote sensing data.

Uploaded by

Geo Spatialist
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)
120 views7 pages

Google Earth Engine Tutorial Pt. IV: Pixel Selection Zachary Noah and J.B. Sharma, University of North Georgia

This tutorial teaches how to select pixels from raster images using conditional statements and logical operators in Google Earth Engine. It demonstrates selecting pixels from a terrain dataset based on elevation, from a Landsat image based on NDVI values, and combining selections across images. The objectives are to learn pixel selection, select from multiple bands/images, and create a new image with selected pixels. The tutorial uses Landsat 8 and global terrain data, selecting mountain tops, high NDVI values, and combinations of conditions. It concludes by asking students to apply these skills to answer a question using remote sensing data.

Uploaded by

Geo Spatialist
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/ 7

Google Earth Engine Tutorial Pt.

IV
Pixel Selection
Zachary Noah and J.B. Sharma, University of North Georgia

Objectives:
This will teach how to select pixels from rasters with conditional statements and boolean
operators. Along with this, will select from multiple bands and images to create a single
selection. Finally, you will create a new image and transfer selected pixels to the new image.
Introduction:
Raster images consist of a matrix of equal sized pixels. Each pixel contains a digital number
(DN) within the range of the bit depth. Multispectral images consists of multiple images
containing grids of pixels. GEE allows you to select certain pixels based on digital numbers, for
example selecting all pixels where the DN is greater than 50 and less than 150. In this tutorial
you will learn how to select pixels by certain conditions. This tutorial will use both the
LANDSAT 8 imagery and terrain imagery. The LANDSAT image has already been composited
as you learned how to do in the previous tutorials.
Procedure:
1. Import the “Global Multi-resolution Terrain Elevation Data 2010” dataset, rename the
variable to terrain. Use the Map.addLayer() function to add the dataset to the map.
Stretch the data to 2 standard deviations using the visualizations tool and input the new
range as the min and max values in visualization parameter

1
Image variables have a variety of methods for comparison, such as image.lt(), which selects only
the pixels with a DN value less than the parameter of the .lt() function. There are also the .gt(),
.gte(), and .lte() methods, where the .gte() represents “greater than or equal to”.
2. Try to select only the tops of mountains.

2
The height value can be played with, but this illustrates a simple way of selecting based on a
single condition. The selection created a new layer where all the selected pixels have a value of 1
and the unselected pixels have a value of 0.
3. To remove the unselected pixels from the image, use the masking function. Masking will
be explained in more detail in a later tutorial, but for now you can mask a layer to itself in
order to remove the 0 pixels with ‘image.mask(image)’

Move on to the LANDSAT imagery and later you will combine LANDSAT selection with
elevation.
4. First, use the .normalizedDifference() function to create an NDVI layer from the
LANDSAT layer. In the next lesson the NDVI will be calculated manually but for now
use the built-in function.

3
Note how 7 hex colors are used to create a green-red color ramp. Also note that for LANDSAT
8, the NIR band is band 5 and red band is band 4. Since the NDVI is a single band image, select
by conditions similarly to the way the terrain image was selected.

4
This selects all pixels which have an NDVI greater than .5, again the masking trick is used to
remove non-0 pixels. The palette has been set to black for easier visibility.
5. Next, create a selection based on a range of data by creating a selection of pixels that
have an NDVI between -.5 and .5

5
Observe that most of the country is in this range where only the clear areas are not. The .and()
function is what is used to chain conditions together. This can be counterintuitive but will
become clearer as time goes by. You can mix conditions across as many images as you’d like.
See what happens when a high NDVI and a low altitude are queried.

6
This query has selected the Sacramento Valley, The Willamette National Forest, most of
Georgia, and parts of South Carolina. Due to the fact that the query selects Georgia, South
Carolina, and the land around the Mississippi Delta, this suggests that these parameters could be
combined with soil data to identify good locations to grow cotton.
Conclusion:
Selection is one of the primary tools you must be able to use before you can either do raster
algebra or classification. The selection in somewhat counterintuitive in JavaScript but is a
necessary concept to learn and once you master it, it will powerful abilities in Google Earth
Engine.
6. Choose a particular geographic area and pose a question that can be answered using
remotely sensed data and the skills learned on Tutorials 1 thru 4. Produce a map
composition and an analysis of what the map represents.

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


License.

You might also like