FormalPara Overview

The purpose of this chapter is to introduce you to the many types of collections of images available in Google Earth Engine. These include sets of individual satellite images, pre-made composites (which merge multiple individual satellite images into one composite image), classified land use and land cover (LULC) maps, weather data, and other types of datasets. If you are new to JavaScript or programming, work through Chaps. 1 and 2 first.

FormalPara Learning Outcomes
  • Accessing and viewing sets of images in Earth Engine.

  • Extracting single scenes from collections of images.

  • Applying visualization parameters in Earth Engine to visualize an image.

Assumes you know how to

  • Sign up for an Earth Engine account, open the Code Editor, and save your script. (Chap. 1)

  • Locate the Earth Engine Inspector and Console tabs and understand their purposes (Chap. 1).

  • Use the Inspector tab to assess pixel values (Chap. 2).

1 Introduction to Theory

The previous chapter introduced you to images, one of the core building blocks of remotely sensed imagery in Earth Engine. In this chapter, we will expand on this concept of images by introducing image collections. Image collections in Earth Engine organize many different images into one larger data storage structure. Image collections include information about the location, date collected, and other properties of each image, allowing you to sift through the ImageCollection for the exact image characteristics needed for your analysis.

2 Practicum

There are many different types of image collections available in Earth Engine. These include collections of individual satellite images, pre-made composites that combine multiple images into one blended image, classified LULC maps, weather data, and other non-optical datasets. Each one of these is useful for different types of analyses. For example, one recent study examined the drivers of wildfires in Australia (Sulova and Jokar 2021). The research team used the European Center for Medium-Range Weather Forecast Reanalysis (ERA5) dataset produced by the European Center for Medium-Range Weather Forecasts (ECMWF) and is freely available in Earth Engine. We will look at this dataset later in the chapter.

2.1 Section 1: Image Collections: An Organized Set of Images

If you have no already done so, you add the book's code repository to the Code Editor by entering https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book into your browser. The book's scripts will then be available in the script manager panel to view, run, or modify. If you have trouble finding the repo, you can visit http://bit.ly/EEFA-repo-help for help. 

You saw some of the basic ways to interact with an individual ee.Image in Chap. 2. However, depending on how long a remote sensing platform has been in operation, there may be thousands or millions of images collected of Earth. In Earth Engine, these are organized into an ImageCollection, a specialized data type that has specific operations available in the Earth Engine API. Like individual images, they can be viewed with Map.addLayer.

You will learn to work with image collections in complex ways later in the book, particularly in Part IV. For now, we will show you how to view and work with their most basic attributes and use these skills to view some of the major types of image collections in Earth Engine. This chapter will give a brief tour of the Earth Engine Data Catalog, which contains decades of satellite imagery and much more. We will view some of the different types of datasets in the following sections, including climate and weather data, digital elevation models and other terrain data, land cover, cropland, satellite imagery, and others.

View an Image Collection

The Landsat program from NASA and the United States Geological Survey (USGS) has launched a sequence of Earth observation satellites, named Landsat 1, 2, etc. Landsats have been returning images since 1972, making that collection of images the longest continuous satellite-based observation of the Earth's surface. We will now view images and basic information about one of the image collections that is still growing: collections of scenes taken by the Operational Land Imager aboard Landsat 8, which was launched in 2013. Copy and paste the following code into the center panel and click Run. While the enormous image catalog is accessed, it could take a couple of minutes to see the result in the Map area. You may note individual “scenes” being drawn, which equate to the way that the Landsat program partitions Earth into “paths” and “rows”. If it takes more than a couple of minutes to see the images, try zooming in to a specific area to speed up the process.

A code to view an image collection. It imports the Landsat 8 raw collection and prints the size, tries to print it, and displays an error with a warning. It adds Landsat 8 dataset to the map as a mosaic to display the most recent pixel.

First, let us examine the map output (Fig. 3.1).

Fig. 3.1
A screenshot represents a map near the Gulf of Mexico and the North Atlantic Ocean. There are a few options on the screen to zoom in and out, view the layers and the buttons for map and satellite view.

USGS Landsat 8 collection 2 Tier 1 Raw Scenes collection

Notice the high amount of cloud cover and the “layered” look. Zoom out if needed. This is because Earth Engine is drawing each of the images that make up the ImageCollection one on top of the other. The striped look is the result of how the satellite collects imagery. The overlaps between images and the individual nature of the images mean that these are not quite ready for analysis; we will address this issue in future chapters.

Now examine the printed size on the Console. It will indicate that there are more than a million images in the dataset (Fig. 3.2). If you return to this lab in the future, the number will be even larger, since this active collection is continually growing as the satellite gathers more imagery. For the same reason, Fig. 3.1 might look slightly different on your map because of this.

Fig. 3.2
A screenshot exhibits a console window. it denotes the size of the Landsat 8 collection is 1276402 inside a rectangular box.

Size of the entire Landsat 8 collection. Note that this number is constantly growing

Note that printing the ImageCollection returned an error message (Fig. 3.3), because calling print on an ImageCollection will write the name of every image in the collection to the Console. This is the result of an intentional safeguard within Earth Engine. We do not want to see a million image names printed to the Console!

Fig. 3.3
A screenshot exhibits a dialog box. It highlights a text that reads the image collection error and states that the collection query aborted after accumulating over 5000 elements.

Error encountered when trying to print the names and information to the screen for too many elements

Code Checkpoint F12a. The book’s repository contains a script that shows what your code should look like at this point.

Edit your code to comment out the last two code commands you have written. This will remove the call to Map.addLayer that drew every image, and will remove the print statement that demanded more than 5000 elements. This will speed up your code in subsequent sections. As described in Chap. 1, placing two forward slashes (//) at the beginning of a line will make it into a comment, and any commands on that line will not be executed.

Filtering Image Collections

The ImageCollection data type in Earth Engine has multiple approaches to filtering, which helps to pinpoint the exact images you want to view or analyze from the larger collection.

Filter by Date

One of the filters is filterDate, which allows us to narrow down the date range of the ImageCollection. Copy the following code to the center panel (paste it after the previous code you had):

10 lines of code to filter an image collection and to filter the collection by date. It prints the size of the Winter Landsat 8 image collection at the end.

Examine the mapped landsatWinter (Fig. 3.4). As described in Chap. 2, the 5000 and the 15000 values in the visualization parameters of the Map.addLayer function of the code above refer to the minimum and maximum of the range of display values.

Fig. 3.4
A screenshot represents a map highlighting Landsat 8 winter collection.

Landsat 8 winter collection

Now, look at the size of the winter Landsat 8 collection. The number is significantly lower than the number of images in the entire collection. This is the result of filtering the dates to three months in the winter of 2020–2021.

Filter by Location

A second frequently used filtering tool is filterBounds. This filter is based on a location—for example, a point, polygon, or other geometry. Copy and paste the code below to filter and add to the map the winter images from the Landsat 8 Image Collection to a point in Minneapolis, Minnesota, USA. Note below the Map.addLayer function to add the pointMN to the map with an empty dictionary {} for the visParams argument. This only means that we are not specifying visualization parameters for this element, and it is being added to the map with the default parameters.

13 lines of code to create an earth engine point object, to filter and add the point to the map. It prints the size of the Minneapolis winter Landsat at the end.

If we uncheck the Winter Landsat 8 layer under Layers, we can see that only images that intersect our point have been selected (Fig. 3.5). Zoom in or out as needed. Note the printed size of the Minneapolis winter collection—we only have seven images.

Fig. 3.5
A map highlights the Minneapolis winter collection filtered by bounds with zoom-in and zoom-out versions. It denotes the layers of point M N and M N Landsat 8.

Minneapolis winter collection filtered by bounds. The first still represents the map without zoom applied. The collection is shown inside the red circle. The second still represents the map after zoom was applied to the region. The red arrow indicates the point (in black) used to filter by bounds

Selecting the First Image

The final operation we will explore is the first function. This selects the first image in an ImageCollection. This allows us to place a single image on the screen for inspection. Copy and paste the code below to select and view the first image of the Minneapolis Winter Landsat 8 Image Collection. In this case, because the images are stored in time order in the ImageCollection, it will select the earliest image in the set.

9 lines of code to select the first image in the filtered collection and to display the first image in the filtered collection.

The first command takes our stack of location-filtered images and selects the first image. When the layer is added to the Map area, you can see that only one image is returned—remember to uncheck the other layers to be able to visualize the full image (Fig. 3.6). We used the Map.centerObject to center the map on the landsatFirst image with a zoom level of 7 (zoom levels go from 0 to 24).

Fig. 3.6
A map highlights the first Landsat image from the filtered set.

First Landsat image from the filtered set

Code Checkpoint F12b. The book’s repository contains a script that shows what your code should look like at this point.

Now that we have the tools to examine different image collections, we will explore other datasets. Save your script for your own future use, as outlined in Chap. 1. Then, refresh the Code Editor to begin with a new script for the next section.

2.2 Section 2: Collections of Single Images

When learning about image collections in the previous section, you worked with the Landsat 8 raw image dataset. These raw images have some important corrections already done for you. However, the raw images are only one of several image collections produced for Landsat 8. The remote sensing community has developed additional imagery corrections that help increase the accuracy and consistency of analyses. The results of each of these different imagery processing paths are stored in a distinct ImageCollection in Earth Engine.

Among the most prominent of these is the ImageCollection meant to minimize the effect of the atmosphere between Earth’s surface and the satellite. The view from satellites is made imprecise by the need for light rays to pass through the atmosphere, even on the clearest day. There are two important ways the atmosphere obscures a satellite’s view: by affecting the amount of sunlight that strikes the Earth and by altering electromagnetic energy on its trip from its reflection at Earth’s surface to the satellite’s receptors.

Unraveling those effects is called atmospheric correction, a highly complex process whose details are beyond the scope of this book. Thankfully, in addition to the raw images from the satellite, each image for Landsat and certain other sensors is automatically treated with the most up-to-date atmospheric correction algorithms, producing a product referred to as a “surface reflectance” ImageCollection. The surface reflectance estimates the ratio of upward radiance at the Earth's surface to downward radiance at the Earth's surface, imitating what the sensor would have seen if it were hovering a few feet above the ground.

Let us examine one of these datasets meant to minimize the effects of the atmosphere between Earth’s surface and the satellite. Copy and paste the code below to import and filter the Landsat 8 surface reflectance data (landsat8SR) by date and to a point over San Francisco, California, USA (pointSF). We use the first function to select the first image—a single image from March 18, 2014. By printing the landsat8SRimage image on the Console, and accessing its metadata (see Chap. 2), we see that the band names differ from those in the raw image (Fig. 3.7). Here, they have the form “SR_B*” as in “Surface Reflectance Band *”, where * is the band number. We can also check the date of the image by looking at the image “id” (Fig. 3.7). This has the value “20140318”, a string indicating that the image was from March 18, 2014.

Fig. 3.7
A screenshot of the console window. It highlights the Landsat 8 surface reflectance image bands and the date which denote the bands from 1 to 7 and the id that is 20140318.

Landsat 8 surface reflectance image bands and date

A set of lines of code represent the collection of single images of Landsat 8 surface reflectance. It creates an earth engine point over San Francisco, imports the Landsat 8 surface reflectance collection, filters the collection, and selects the first image.

Copy and paste the code below to add this image to the map with adjusted R, G, and B bands in the “bands” parameter for true-color display (see Chap. 2).

A set of lines of code to create a map to the first image and to add the first image to the top.

Compare this image (Fig. 3.8) with the raw Landsat 8 images from the previous section (Fig. 3.6). Zoom in and out and pan the screen as needed. What do you notice? Save your script but don’t start a new one—we will keep adding code to this script.

Fig. 3.8
A map highlights Landsat 8 surface reflectance scene. A satellite image is layered over the map.

Landsat 8 surface reflectance scene from March 18, 2014

Code Checkpoint F12c. The book’s repository contains a script that shows what your code should look like at this point.

2.3 Section 3: Pre-made Composites

Pre-made composites take individual images from image collections across a set area or time period and assemble them into a single layer. This can be done for many different datasets, including satellite images (e.g., MODIS, Landsat, Sentinel), climatological information, forest or vegetation information, and more.

For example, image collections may have multiple images in one location, as we saw in our “filter by location” example above. Some of the images might have a lot of cloud cover or other atmospheric artifacts that make the imagery quality poor. Other images might be very high quality, because they were taken on sunny days when the satellite was flying directly overhead. The compositing process takes all of these different images, picks the best ones, and then stitches them together into a single layer. The compositing period can differ for different datasets and goals; for example, you may encounter daily, monthly, and/or yearly composites. To do this manually is more advanced (see, for example, Chap. 15); however, with the pre-made composites available in Earth Engine, some of that complex work has been done for you.

MODIS Daily True-Color Imagery

We will explore two examples of composites made with data from the MODIS sensors, a pair of sensors aboard the Terra and Aqua satellites. On these complex sensors, different MODIS bands produce data at different spatial resolutions. For the visible bands, the lowest common resolution is 500 m (red and NIR are 250 m).

Let us use the code below to import the MCD43A4.006 MODIS Nadir BRDF-Adjusted Reflectance Daily 500 m dataset and view a recent image. This dataset is produced daily based on a 16-day retrieval period, choosing the best representative pixel from the 16-day period. The 16-day period covers about eight days on either side of the nominal compositing date, with pixels closer to the target date given a higher priority.

A textbox represents 12 lines of code to import a M O D I S dataset of daily B R D F corrected reflectance, filter the dataset to a recent date, and add the dataset to the map.

Uncheck the other layer (“Landsat 8 SR”), zoom out (e.g., country-scale), and pan around the image (Fig. 3.9). Notice how there are no clouds in the image, but there are some pixels with no data (Fig. 3.10). These are persistently cloudy areas that have no clear pixels in the particular period chosen.

Fig. 3.9
A map highlights M O D I S daily true-color image. It highlights the layers of M O D I S daily composite.

MODIS Daily true-color image

Fig. 3.10
A map highlights gaps on the M O D I S daily true-color image near Denver, Colorado, U S A. The gaps are denoted in lighter shades.

Examples of gaps on the MODIS Daily true-color image near Denver, Colorado, USA

MODIS Monthly Burned Areas

Some of the MODIS bands have proven useful in determining where fires are burning and what areas they have burned. A monthly composite product for burned areas is available in Earth Engine. Copy and paste the code below.

A textbox represents 3 lines of code to import the M O D I S monthly burned areas dataset, filter the dataset to a recent month during fire season, and add the dataset to the map.

Uncheck the other layers, and then pan and zoom around the map. Areas that have burned in the past month will show up as red (Fig. 3.11). Can you see where fires burned areas of California, USA? In Southern and Central Africa? Northern Australia?

Fig. 3.11
A map highlights M O D I S monthly burn image over California. It denotes a checkmark beside a layer named M O D I S monthly burn.

MODIS Monthly Burn image over California

Code Checkpoint F12d. The book’s repository contains a script that shows what your code should look like at this point.

Save your script and start a new one by refreshing the page.

2.4 Section 4: Other Satellite Products

Satellites can also collect information about the climate, weather, and various compounds present in the atmosphere. These satellites leverage portions of the electromagnetic spectrum and how different objects and compounds reflect when hit with sunlight in various wavelengths. For example, methane (CH4) reflects the 760 nm portion of the spectrum. Let us take a closer look at a few of these datasets.

Methane

The European Space Agency makes available a methane dataset from Sentinel-5 in Earth Engine. Copy and paste the code below to add to the map methane data from the first time of collection on November 28, 2018. We use the select function (See Chap. 2) to select the methane-specific band of the dataset. We also introduce values for a new argument for the visualization parameters of Map.addLayer: We use a color palette to display a single band of an image in color. Here, we chose varying colors from black for the minimum value to red for the maximum value. Values in between will have the color in the order outlined by the palette parameter (a list of string colors: black, blue, purple, cyan, green, yellow, red).

A textbox represents 13 lines of code to import a sentinel 5 methane dataset, filter the methane dataset, make a visualization for the methane data, create a map, and add the methane dataset to the map.

Notice the different levels of methane over the African continent (Fig. 3.12).

Fig. 3.12
A world map highlights methane levels over the African continent. The northwest and southwest regions are highlighted.

Methane levels over the African continent on November 28, 2018

Weather and Climate Data

Many weather and climate datasets are available in Earth Engine. One of these is the European Center for Medium-Range Weather Forecast Reanalysis (ERA5) dataset used by Sulova and Jokar (2021). Copy and paste the code below to add the January 2018 monthly data to the map.

A textbox represents 11 lines of code to import the E R A 5 monthly dataset, filter the dataset, and add the E R A dataset to the map.

Examine some of the temperatures in this image (Fig. 3.13) by using the Inspector tool (see Chap. 2). Pan and zoom out if needed. The units are in Kelvin, which is Celsius plus 273.15°.

Fig. 3.13
A screenshot of E R A 5 maximum monthly temperature. It exhibits buttons to zoom in, zoom out, drag, and view the layers, along with other options.

ERA5 maximum monthly temperature, January 2018

Code Checkpoint F12e. The book’s repository contains a script that shows what your code should look like at this point.

Save your script and start a new one by refreshing the page.

2.5 Section 5: Pre-classified Land Use and Land Cover

Another type of dataset available in Earth Engine is LULC maps that have already been classified. Instead of showing how the Earth’s surface looks—that is, the visible and other electromagnetic spectrum reflectance detected by satellites—these datasets take satellite imagery and use it to assign a label to each pixel on Earth’s surface. For example, categories might include vegetation, bare soil, built environment (pavement, buildings), and water.

Let us take a closer look at two of these datasets.

ESA WorldCover

The European Space Agency (ESA) provides a global land cover map for the year 2020 based on Sentinel-1 and Sentinel-2 data. WorldCover uses 11 different land cover classes including built-up, cropland, open water, and mangroves. Copy and paste the code below to add this image to the map. In this dataset, the band 'Map' already contains a palette color associated with the 11 land cover class values.

A textbox represents 5 lines of code to import the E S A world cover dataset, center the map, and add the world cover later to the map.

Examine the WorldCover land cover classification (Fig. 3.14). Compare it with some of the satellite imagery we have explored in previous sections. Chapter 4 shows how to determine the meaning of the colors and values in a dataset like this.

Fig. 3.14
A world map highlights different regions of Africa and America in darker and lighter shades. Most of the highlighted region falls under the southern part of Africa and the northern part of South America.

ESA’s 2020 WorldCover map

Global Forest Change

Another land cover product that has been pre-classified for you and is available in Earth Engine is the Global Forest Change dataset. This analysis was conducted between 2000 and 2020. Unlike the WorldCover dataset, this dataset focuses on the percent of tree cover across the Earth’s surface in a base year of 2000, and how that has changed over time. Copy and paste the code below to visualize the tree cover in 2000. Note that in the code below we define the visualization parameters as a variable treeCoverViz instead of having its calculation done within the Map.addLayer function.

A textbox represents 9 lines of code to import the Hansen global forest change dataset, create a visualization for tree cover in 2000, and add the 2000 tree cover image to the map.

Notice how areas with high tree cover (e.g., the Amazon) are greener and areas with low tree cover are darker (Fig. 3.15). In case you see an error on the Console such as “Cannot read properties of null”, do not worry. Sometimes Earth Engine will show these transient errors, but they will not affect the script in any way.

Fig. 3.15
A screenshot represents a world map that highlights the Global Forest Change 2000 tree cover layer. It exhibits buttons to zoom in, zoom out, drag, and view the layers, along with other options.

Global Forest Change 2000 tree cover layer

Copy and paste the code below to visualize the tree cover loss over the past 20 years.

A textbox represents 7 lines of code to create a visualization for the year of tree loss over the past 20 years and add the 2000 to 2020 tree cover loss image to the map.

Leave the previous 2000 tree cover layer checked and analyze the loss layer on top of it—yellow, orange, and red areas (Fig. 3.16). Pan and zoom around the map. Where has there been recent forest loss (which is shown in red)?

Fig. 3.16
A world map highlights Global Forest Change from 2000 to 2020 and the 2000 tree cover layer. It highlights the northern part of South America and the central part of Africa.

Global Forest Change 2000–2020 tree cover loss (yellow–red) and 2000 tree cover (black-green)

Code Checkpoint F12f. The book’s repository contains a script that shows what your code should look like at this point.

Save your script and start a new one.

2.6 Section 6: Other Datasets

There are many other types of datasets in the Earth Engine Data Catalog that you can explore and use for your own analyses. These include global gridded population counts, terrain, and geophysical data. Let us explore two of these datasets now.

Gridded Population Count

The Gridded Population of the World dataset estimates human population for each grid cell across the entire Earth’s surface. Copy and paste the code below to add the 2000 population count layer. We use a predefined palette populationPalette, which is a list of six-digit strings of hexadecimal values representing additive RGB colors (as first seen in Chap. 2). Lighter colors correspond to lower population count, and darker colors correspond to higher population count.

A set of 19 lines of code denote the commands to import and filer a gridded population dataset, predefined palette, center the map, and add the population data to the map,

Pan around the image (Fig. 3.17). What happens when you change the minimum and maximum values in the visualization? As described in Chap. 2, the minimum and maximum values represent the range of values of the dataset. Identify a location of interest to you—may be an area near your current location, or your hometown. If you click on the Inspector tab, you should be able to find the population count (Fig. 3.18).

Fig. 3.17
A world map highlights the gridded population count of 2000. The Shades are denser across the map of India.

Gridded population count of 2000

Fig. 3.18
A screenshot of the console window highlights the gridded population as image, 1 band, and the population count as 9833.37109375.

2000 population count for a point near Rio de Janeiro, Brazil

Digital Elevation Models

Digital elevation models (DEMs) use airborne and satellite instruments to estimate the elevation of each location. Earth Engine has both local and global DEMs available. One of the global DEMs available is the NASADEM dataset, a DEM produced from a NASA mission. Copy and paste the code below to import the dataset and visualize the elevation band.

A text box represents 6 lines of code to import the NASA D E M dataset and add the elevation layer to the map.

Uncheck the population layer and zoom in to examine the patterns of topography (Fig. 3.19). Can you see where a mountain range is located? Where is a river located? Try changing the minimum and maximum in order to make these features more visible. Save your script.

Fig. 3.19
A world map highlights NASA D E M elevation. It highlights the regions in South America, Africa, and the southern part of Asia in darker and lighter shades.

NASADEM elevation

Code Checkpoint F12g. The book’s repository contains a script that shows what your code should look like at this point.

Take a moment to look through all of the different layers that we have explored so far. You can open your scripts one at a time or in different tabs, or even by copying the code into one single script. Turn the layers on and off, pan around, and zoom in and out accordingly to visualize the different datasets on the map.

3 Synthesis

Assignment 1. Explore the Earth Engine Data Catalog and find a dataset that is near your location. To do this, you can type keywords into the search bar, located above the Earth Engine code. Import a dataset into your workspace and filter the dataset to a single image. Then, print the information of the image into the Console and add the image to the map, either using three selected bands or a custom palette for one band.

4 Conclusion

In this chapter, we introduced image collections in Earth Engine and learned how to apply multiple types of filters to image collections to identify multiple or a single image for use. We also explored a few of the many different image collections available in the Earth Engine Data Catalog. Understanding how to find, access, and filter image collections is an important step in learning how to perform spatial analyses in Earth Engine.