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 –

A. Open a new script
1. Open the Code Editor webpage in Google Chrome, if it is not already open:
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.


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.


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

// print(L8_collection);



    1. I’m new to GEE, so someone correct me if I’m wrong. I believe the error is thrown by the ‘print’ statement, which is why the author suggested to comment it out. I don’t think that GEE can provide the number of elements if it surpasses 5000. The next lesson (‘Filter Image Collection with a Spatial Boundary’) shows how to restrict the spatial area, which should resolve the issue if reduced enough. If you’re unable to export due to size but want to keep the size of the area, you can increase the allowed pixel size within the export function (maxPixels: 500000000).

Leave a Reply