Working with GEE Image Collections

Image collections contain all images of a specific satellite.

This introductory training is part of the official training materials prepared by the United States Department of Agriculture.

The Code Editor offers access to the full power of Earth Engine; however, a basic understanding of the fundamentals of coding and JavaScript is required. In this exercise, you will continue to learn about JavaScript syntax and some new Earth Engine spatial data concepts. You will build what you learned in exercise two about image objects; however you will now turn your focus to working with collections of images, or stacks of similar image objects. In this exercise, you will focus on basic concepts and methods associated with image collections in Earth Engine. This is an introduction to get users writing some simple JavaScript scripts.

Working with Image Collections

An image collection refers to a set of images of a like type in Earth Engine. For example, all the Landsat 8 images in GEE are in an image collection.

In the Code Editor, you can work with the entire collection of images of a given type, or you can use filters to create specific Image Collections (e.g., representing a specific study area or for a specified time period). Read more here – https://developers.google.com/earth-engine/ic_info

A. Open a new script
1. Open the Code Editor webpage in Google Chrome, if it is not already open: https://code.earthengine.google.com/
2. Click on the dropdown arrow adjacent to the Reset button and select Clear script.

B. Create a Landsat Image Collection object
1. Create an image collection of all the available Landsat 8 images by typing or copy/paste the code below into the code editor.

// Get a collection.
var L8_collection = ee.ImageCollection('LANDSAT/LC8_L1T_TOA');

2. Next we can add this to the map, copy the code below and paste it into the code editor. Then click Run to execute all the lines.

Map.addLayer(L8_collection, { min:0.05, max: 0.8, bands: 'B6, B5, B4' }, 'Landsat Collection');
Map.setCenter(100.56, 13.94, 7);

i. What is mapped here? The image collection has a number of images, but not all are mapped. When we use the Map.addLayer function to add an image collection to our map window, by default the most recent pixel is shown.

3. (Optional) If we add a print statement, we can determine how many images are in our collection. Copy and paste the following lines into the bottom of your script.
print(L8_collection);

print(L8_collection);

i. However, since our image collection is rather large, we get an error message printed into the Console. The print Collection query aborted after accumulating the metadata for over 5,000 elements. We will filter our collection down by space and time parameters and learn a better way to get a count of the number of images in our image collection.

assign3_1.jpg

ii. Comment out the print statement. We will return to this later.

// print(L8_collection);

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s