ship detection

This commit is contained in:
Ollie Ballinger
2022-12-27 11:59:44 +00:00
parent 7082872429
commit ad74d1fef0
106 changed files with 7423 additions and 5642 deletions

142
F1.qmd
View File

@@ -1,31 +1,31 @@
# Getting Started
## Getting Started
# Programming Basics
## Programming Basics
::: {.callout-tip}
# Chapter Information
## Chapter Information
## Author{.unlisted .unnumbered}
### Author{.unlisted .unnumbered}
Ujaval Gandhi
## Overview {.unlisted .unnumbered}
### Overview {.unlisted .unnumbered}
This chapter introduces the Google Earth Engine application programming interface (API) and the JavaScript syntax needed to use it. You will learn about the Code Editor environment and get comfortable typing, running, and saving scripts. You will also learn the basics of JavaScript language, such as variables, data structures, and functions.
## Learning Outcomes{.unlisted .unnumbered}
### Learning Outcomes{.unlisted .unnumbered}
* Familiarity with the Earth Engine Code Editor.
* Familiarity with the JavaScript syntax.
* Ability to use the Earth Engine API functions from the Code Editor.
## Assumes you know how to:{.unlisted .unnumbered}
### Assumes you know how to:{.unlisted .unnumbered}
* Sign up for an Earth Engine account (See the Google documentation for details).
* Access the Earth Engine Code Editor (See the Google documentation for details).
:::
## Introduction {.unlisted .unnumbered}
### Introduction {.unlisted .unnumbered}
In order to use Earth Engine well, you will need to develop basic skills in remote sensing and programming. The language of this book is JavaScript, and you will begin by learning how to manipulate variables using it. With that base, youll learn about viewing individual satellite images, viewing collections of images in Earth Engine, and how common remote sensing terms are referenced and used in Earth Engine.
@@ -35,7 +35,7 @@ An API is a way to communicate with Earth Engine servers. It allows you to speci
The Earth Engine platform comes with a web-based Code Editor that allows you to start using the Earth Engine JavaScript API without any installation. It also provides additional functionality to display your results on a map, save your scripts, access documentation, manage tasks, and more. It has a one-click mechanism to share your code with other users—allowing for easy reproducibility and collaboration. In addition, the JavaScript API comes with a user interface library, which allows you to create charts and web-based applications with little effort.
## Getting Started in the Code Editor
### Getting Started in the Code Editor
If you have not already done so, be sure to add the books code repository to the Code Editor by entering [](https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092101269&usg=AOvVaw2sJyDO_fhq1tcjG77pri7V)[https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book](https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092101852&usg=AOvVaw088kfXu4o_Mp4b8DJBPYjH) into your browser. The books scripts will then be available in the script manager panel. If you have trouble finding the repo, you can visit [this link](https://www.google.com/url?q=https://docs.google.com/presentation/d/1Kt6wGNoesYm__Cu3k3bnlbbyPN6m9SF4hQHK-pIDHfc/edit%23slide%3Did.g18a7b4b055d_0_624&sa=D&source=editors&ust=1670414092102526&usg=AOvVaw3ZCmkCOjrZEWqxfjRZPOCn) for help.
@@ -76,11 +76,11 @@ Once the script is saved, it will appear in the script manager panel (Fig. F1.0.
Now you should be familiar with how to create, run, and save your scripts in the Code Editor. You are ready to start learning the basics of JavaScript.
## JavaScript Basics
### JavaScript Basics
To be able to construct a script for your analysis, you will need to use JavaScript. This section covers the JavaScript syntax and basic data structures. In the sections that follow, you will see more JavaScript code, noted in a distinct font and with shaded background. As you encounter code, paste it into the Code Editor and run the script.
### Variables {.unnumbered}
#### Variables {.unnumbered}
In a programming language, variables are used to store data values. In JavaScript, a variable is defined using the var keyword followed by the name of the variable. The code below assigns the text “San Francisco” to the variable named city. Note that the text string in the code should be surrounded by quotes. You are free to use either ' (single quotes) or " (double quotes), and they must match at the beginning and end of each string. In your programs, it is advisable to be consistent—use either single quotes or double quotes throughout a given script (the code in this book generally uses single quotes for code). Each statement of your script should typically end with a semicolon, although Earth Engines code editor does not require it. 
@@ -96,7 +96,7 @@ When you assign a text value, the variable is automatically assigned the type st
var population = 873965;
print(population);
```
### Lists {.unnumbered}
#### Lists {.unnumbered}
It is helpful to be able to store multiple values in a single variable. JavaScript provides a data structure called a list that can hold multiple values. We can create a new list using the square brackets [] and adding multiple values separated by a comma.
```js
@@ -108,7 +108,7 @@ If you look at the output in the Console, you will see “List” with an expand
![Fig. F1.0.8 A JavaScript list](F1/image10.png)
### Objects {.unnumbered}
#### Objects {.unnumbered}
Lists allow you to store multiple values in a single container variable. While useful, it is not appropriate to store structured data. It is helpful to be able to refer to each item with its name rather than its position. Objects in JavaScript allow you to store key-value pairs, where each value can be referred to by its key. You can create a dictionary using the curly braces {}. The code below creates an object called cityData with some information about San Francisco.
@@ -125,7 +125,7 @@ We can use multiple lines to define the object. Only when we put in the semicolo
![Fig. F1.0.9 A JavaScript object](F1/image40.png)
### Functions {.unnumbered}
#### Functions {.unnumbered}
While using Earth Engine, you will need to define your own functions. Functions take user inputs, use them to carry out some computation, and send an output back. Functions allow you to group a set of operations together and repeat the same operations with different parameters without having to rewrite them every time. Functions are defined using the `function` keyword. The code below defines a function called greet that takes an input called name and returns a greeting with Hello prefixed to it. Note that we can call the function with different input and it generates different outputs with the same code.
```js
@@ -139,7 +139,7 @@ print(greet('Readers'));
```
![Fig. F1.0.10 JavaScript function output](F1/image54.png)
### Comments {.unnumbbered}
#### Comments {.unnumbbered}
While writing code, it is useful to add a bit of text to explain the code or leave a note for yourself. It is a good programming practice to always add comments in the code explaining each step. In JavaScript, you can prefix any line with two forward slashes // to make it a comment. The text in the comment will be ignored by the interpreter and will not be executed.
@@ -153,7 +153,7 @@ Congratulations! You have learned enough JavaScript to be able to use the Earth
Code Checkpoint F10a. The books repository contains a script that shows what your code should look like at this point.
:::
## Earth Engine API Basics
### Earth Engine API Basics
The Earth Engine API is vast and provides objects and methods to do everything from simple math to advanced algorithms for image processing. In the Code Editor, you can switch to the Docs tab to see the API functions grouped by object types. The API functions have the prefix ee (for Earth Engine).
@@ -196,25 +196,25 @@ You just accomplished a moderately complex programming task with the help of Ear
Code Checkpoint F10b. The books repository contains a script that shows what your code should look like at this point.
:::
## Conclusion {.unnumbered}
### Conclusion {.unnumbered}
This chapter introduced the Earth Engine API. You also learned the basics of JavaScript syntax to be able to use the API in the Code Editor environment. We hope you now feel a bit more comfortable starting your journey to become an Earth Engine developer. Regardless of your programming background or familiarity with JavaScript, you have the tools at your disposal to start using the Earth Engine API to build scripts for remote sensing analysis.
# Exploring Images
## Exploring Images
::: {.callout-tip}
# Chapter Information
## Chapter Information
## Author {.unlisted .unnumbered}
### Author {.unlisted .unnumbered}
Jeff Howarth
## Overview {.unlisted .unnumbered}
### Overview {.unlisted .unnumbered}
Satellite images are at the heart of Google Earth Engines power. This chapter teaches you how to inspect and visualize data stored in image bands. We first visualize individual bands as separate map layers and then explore a method to visualize three different bands in a single composite layer. We compare different kinds of composites for satellite bands that measure electromagnetic radiation in the visible and non-visible spectrum. We then explore images that represent more abstract attributes of locations, and create a composite layer to visualize change over time.  
## Learning Outcomes {.unlisted .unnumbered}
### Learning Outcomes {.unlisted .unnumbered}
* Using the Code Editor to load an image
* Using code to select image bands and visualize them as map layers
@@ -222,12 +222,12 @@ Satellite images are at the heart of Google Earth Engines power. This chapter
* Constructing new multiband images.
* Understanding how additive color works and how to interpret RGB composites.
## Assumes you know how to: {.unlisted .unnumbered}
### Assumes you know how to: {.unlisted .unnumbered}
* Sign up for an Earth Engine account, open the Code Editor, and save your script (Chap. F1.0).
:::
## Accessing an Image
### Accessing an Image
If you have not already done so, be sure to add the books code repository to the Code Editor by entering [](https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092189999&usg=AOvVaw1jWHeBmeq93I_lo_9useCA)[https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book](https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092190705&usg=AOvVaw3Z7cK8r6eOSYUceNjA8oUg) into your browser. The books scripts will then be available in the script manager panel. If you have trouble finding the repo, you can visit [this link](https://www.google.com/url?q=https://docs.google.com/presentation/d/1Kt6wGNoesYm__Cu3k3bnlbbyPN6m9SF4hQHK-pIDHfc/edit%23slide%3Did.g18a7b4b055d_0_624&sa=D&source=editors&ust=1670414092191415&usg=AOvVaw2eETuRpR5worezkj7citx6) for help.
@@ -254,7 +254,7 @@ A satellite sensor like Landsat 5 measures the magnitude of radiation in differ
An image band is an example of a raster data model, a method of storing geographic data in a two-dimensional grid of pixels, or picture elements.
## Visualizing an Image
### Visualizing an Image
Now lets add one of the bands to the map as a layer so that we can see it.  
```js
@@ -324,7 +324,7 @@ By manipulating these controls, you should notice that these layers are displaye
::: {.callout-note}
Code Checkpoint F11a. The books repository contains a script that shows what your code should look like at this point.
:::
## True-Color Composites
### True-Color Composites
Using the controls in the Layers manager, explore these layers and examine how the pixel values in each band differ. Does Layer 2 (displaying pixel values from the “SR_B2” band) appear generally brighter than Layer 1 (the “SR_B1” band)? Compared with Layer 2, do the ocean waters in Layer 3 (the “SR_B3” band) appear a little darker in the north, but a little lighter in the south?  
@@ -343,7 +343,7 @@ The result (Fig. F1.1.4) looks like the world we see, and is referred to as a na
![Fig. F1.1.4 True-color composite](F1/image39.png)
## False-Color Composites
### False-Color Composites
As you saw when you printed the band list (Fig. F1.1.1), a Landsat image contains many more bands than just the three true-color bands. We can make RGB composites to show combinations of any of the bands—even those outside what the human eye can see. For example, band 4 represents the near-infrared band, just outside the range of human vision. Because of its value in distinguishing environmental conditions, this band was included on even the earliest 1970s Landsats. It has different values in coniferous and deciduous forests, for example, and can indicate crop health. To see an example of this, add this code to your script and run it.  
```js
@@ -385,7 +385,7 @@ To compare the two false-color composites, zoom into the area shown in the two p
Code Checkpoint F11b. The books repository contains a script that shows what your code should look like at this point.
:::
## Attributes of Locations
### Attributes of Locations
So far, we have explored bands as a method for storing data about slices of the electromagnetic spectrum that can be measured by satellites. Now we will work towards applying the additive color system to bands that store non-optical and more abstract attributes of geographic locations.  
@@ -410,7 +410,7 @@ With the zoom controls on the map, you can zoom out to see the bright spot of S
![Fig. F1.1.10 Stable nighttime lights in 1993](F1/image34.png)
## Abstract RGB Composites  
### Abstract RGB Composites  
Now we can use the additive color system to make an RGB composite that compares stable nighttime lights at three different slices of time. Add the code below to your script and run it.  
@@ -460,32 +460,32 @@ As you explore this image, remember to check your interpretations with the Inspe
Code Checkpoint F11c. The books repository contains a script that shows what your code should look like at this point.
:::
## Conclusion {.unnumbered}
### Conclusion {.unnumbered}
In this chapter, we looked at how an image is composed of one or more bands, where each band stores data about geographic locations as pixel values. We explored different ways of visualizing these pixel values as map layers, including a grayscale display of single bands and RGB composites of three bands. We created natural and false-color composites that use additive color to display information in visible and non-visible portions of the spectrum. We examined additive color as a general system for visualizing pixel values across multiple bands. We then explored how bands and RGB composites can be used to represent more abstract phenomena, including different kinds of change over time.
# Survey of Raster Datasets
## Survey of Raster Datasets
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.
::: {.callout-tip}
# Chapter Information
## Chapter Information
## Authors {.unlisted .unnumbered}
### Authors {.unlisted .unnumbered}
Andréa Puzzi Nicolau, Karen Dyson, David Saah, Nicholas Clinton
## Overview {.unlisted .unnumbered}
### Overview {.unlisted .unnumbered}
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. F1.0 and F1.1 first.  
## Learning Outcomes {.unlisted .unnumbered}
### Learning Outcomes {.unlisted .unnumbered}
* 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: {.unlisted .unnumbered}
### Assumes you know how to: {.unlisted .unnumbered}
* Sign up for an Earth Engine account, open the Code Editor, and save your script. (Chap. F1.0)
* Locate the Earth Engine Inspector and Console tabs and understand their purposes (Chap. F1.0).
@@ -493,13 +493,13 @@ The purpose of this chapter is to introduce you to the many types of collections
:::
## Image Collections: An Organized Set of Images
### Image Collections: An Organized Set of Images
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 data sets. 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.
You saw some of the basic ways to interact with an individual ee.Image in the previous chapter. 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.
## View an Image Collection
### 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. 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.
@@ -551,11 +551,11 @@ Code Checkpoint F12a. The books repository contains a script that shows what
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. 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
### 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
#### 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):
```js
@@ -581,7 +581,7 @@ Examine the mapped landsatWinter (Fig. F1.2.4). As described in the previous c
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 20202021.
### Filter by Location
#### 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.
```js
@@ -609,7 +609,7 @@ If we uncheck the Winter Landsat 8 layer under Layers, we can see that only imag
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
#### 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.
@@ -636,7 +636,7 @@ Code Checkpoint F12b. The books repository contains a script that shows what
:::
Now that we have the tools to examine different image collections, we will explore other datasets.
## Collections of Single Images
### 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 is stored in a distinct ImageCollection in Earth Engine.
@@ -688,7 +688,7 @@ Code Checkpoint F12c. The books repository contains a script that shows what
:::
## MODIS Monthly Burned Areas
### MODIS Monthly Burned Areas
Well 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).
@@ -713,7 +713,7 @@ Code Checkpoint F12d. The books repository contains a script that shows what
Save your script and start a new one by refreshing the page.
## Methane
### Methane
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. Lets take a closer look at a few of these datasets.
@@ -750,7 +750,7 @@ Notice the different levels of methane over the African continent (Fig. F1.2.12)
![Fig. F1.2.12. Methane levels over the African continent on November 28, 2018](F1/image56.png)
## Global Forest Change
### Global Forest Change
Another useful 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 Earths 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.
@@ -796,7 +796,7 @@ Code Checkpoint F12f. The books repository contains a script that shows what
:::
Save your script and start a new one.
## Digital Elevation Models
### 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.
@@ -821,11 +821,11 @@ Fig. F1.2.18. NASADEM elevation
Code Checkpoint F12g. The books repository contains a script that shows what your code should look like at this point.
:::
## Conclusion {.unnumbered}
### Conclusion {.unnumbered}
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.
## References {.unnumbered}
### References {.unnumbered}
Chander G, Huang C, Yang L, et al (2009) Developing consistent Landsat data sets for large area applications: The MRLC 2001 protocol. IEEE Geosci Remote Sens Lett 6:777781. https://doi.org/10.1109/LGRS.2009.2025244
@@ -835,36 +835,36 @@ Hansen MC, Potapov PV, Moore R, et al (2013) High-resolution global maps of 21st
Sulova A, Arsanjani JJ (2021) Exploratory analysis of driving force of wildfires in Australia: An application of machine learning within Google Earth Engine. Remote Sens 13:123. https://doi.org/10.3390/rs13010010
# The Remote Sensing Vocabulary
## The Remote Sensing Vocabulary
::: {.callout-tip}
# Chapter Information
## Chapter Information
## Authors {.unlisted .unnumbered}
### Authors {.unlisted .unnumbered}
Karen Dyson, Andréa Puzzi Nicolau, David Saah, Nicholas Clinton
## Overview {.unlisted .unnumbered}
### Overview {.unlisted .unnumbered}
The purpose of this chapter is to introduce some of the principal characteristics of remotely sensed images and how they can be examined in Earth Engine. We discuss spatial resolution, temporal resolution, and spectral resolution, along with how to access important image metadata. You will be introduced to image data from several sensors aboard various satellite platforms. At the completion of the chapter, you will be able to understand the difference between remotely sensed datasets based on these characteristics, and how to choose an appropriate dataset for your analysis based on these concepts.  
## Learning Outcomes {.unlisted .unnumbered}
### Learning Outcomes {.unlisted .unnumbered}
* Understanding spatial, temporal, and spectral resolution.
* Navigating the Earth Engine Console to gather information about a digital image, including resolution and other data documentation.
## Assumes you know how to: {.unlisted .unnumbered}
### Assumes you know how to: {.unlisted .unnumbered}
* Navigate among Earth Engine result tabs (Chap. F1.0).
* Visualize images with a variety of false-color band combinations (Chap. F1.1).
:::
## Introduction {.unlisted .unnumbered}
### Introduction {.unlisted .unnumbered}
Images and image collections form the basis of many remote sensing analyses in Earth Engine. There are many different types of satellite imagery available to use in these analyses, but not every dataset is appropriate for every analysis. To choose the most appropriate dataset for your analysis, you should consider multiple factors. Among these are the resolution of the dataset—including the spatial, temporal, and spectral resolutions—as well as how the dataset was created and its quality.
## Searching for and Viewing Image Collection Information
### Searching for and Viewing Image Collection Information
Earth Engines search bar can be used to find imagery and to locate important information about datasets in Earth Engine. Lets use the search bar, located above the Earth Engine code, to find out information about the Landsat 7 Collection 2 Raw Scenes. First, type “landsat 7 collection 2” into the search bar (Fig. F1.3.1). Without hitting Enter, matches to that search term will appear.
@@ -892,13 +892,13 @@ This more complete search results inset window contains short descriptions about
Now that we know how to view this information, lets dive into some important remote sensing terminology.
## Spatial Resolution
### Spatial Resolution
Spatial resolution relates to the amount of Earths surface area covered by a single pixel. For example, we typically say that Landsat 7 has “30 m” color imagery. This means that each pixel is 30 m to a side, covering a total area of 900 square meters of the Earths surface. The spatial resolution of a given data set greatly affects the appearance of images, and the information in them, when you are viewing them on Earths surface.
Next, we will visualize data from multiple sensors that capture data at different spatial resolutions, to compare the effect of different pixel sizes on the information and detail in an image. Well be selecting a single image from each ImageCollection to visualize. To view the image, we will draw them each as a color-IR image, a type of false-color image (described in detail in Chap. F1.1) that uses the infrared, red, and green bands. As you move through this portion of the course, zoom in and out to see differences in the pixel size and the image size.
### Landsat Thematic Mapper
#### Landsat Thematic Mapper
Thematic Mapper (TM) sensors were flown aboard Landsat 4 and 5. TM data have been processed to a spatial resolution of 30m, and were active from 1982 to 2012. Search for “Landsat 5 TM” and import the result called “USGS Landsat 5 TM Collection 2 Tier 1 Raw Scenes”. In this dataset, the three bands for a color-IR image are called “B4” (infrared), “B3” (red), and “B2” (green). Lets now visualize TM data over San Francisco airport. Note that we can either define the visualization parameters as a variable (as in the previous code snippet) or place them in curly braces in the Map.addLayer function (as in this code snippet).
@@ -917,7 +917,7 @@ Map.addLayer(tmImage, {
```
![Fig. F1.3.10 Visualizing the TM imagery from the Landsat 5 satellite](F1/image20.png)
### Sentinel-2 MultiSpectral Instrument
#### Sentinel-2 MultiSpectral Instrument
The MultiSpectral Instrument (MSI) flies aboard the Sentinel-2 satellites, which are operated by the European Space Agency. The red, green, blue, and near-infrared bands are captured at 10m resolution, while other bands are captured at 20m and 30m. The Sentinel-2A satellite was launched in 2015 and the 2B satellite was launched in 2017.
@@ -941,7 +941,7 @@ Compare the Sentinel imagery with the Landsat imagery, using the opacity slider
![Fig. F1.3.11 Visualizing the MSI imagery](F1/image1.png)
### National Agriculture Imagery Program (NAIP)
#### National Agriculture Imagery Program (NAIP)
The National Agriculture Imagery Program (NAIP) is a U.S. government program to acquire imagery over the continental United States using airborne sensors. Data is collected for each state approximately every three years. The imagery has a spatial resolution of 0.52 m, depending on the state and the date collected.  
@@ -970,11 +970,11 @@ Each of the datasets weve examined has a different spatial resolution. By com
Code Checkpoint F13a. The books repository contains a script that shows what your code should look like at this point.
:::
## Temporal Resolution
### Temporal Resolution
Temporal resolution refers to the revisit time, or temporal cadence of a particular sensors image stream. Revisit time is the number of days between sequential visits of the satellite to the same location on the Earths surface. Think of this as the frequency of pixels in a time series at a given location.
### Landsat
#### Landsat
The Landsat satellites 5 and later are able to image a given location every 16 days. Lets use our existing tm dataset from Landsat 5. To see the time series of images at a location, you can filter an ImageCollection to an area and date range of interest and then print it. For example, to see the Landsat 5 images for three months in 1987, run the following code:
@@ -1030,7 +1030,7 @@ When you print the chart, it will have a point each time an image was collected
![Fig. F1.3.15 A chart showing the temporal cadence, or temporal resolution of the Landsat 5 TM instrument at the San Francisco airport](F1/image47.png)
### Sentinel-2
#### Sentinel-2
The Sentinel-2 programs two satellites are in coordinated orbits, so that each spot on Earth gets visited about every 5 days. Within Earth Engine, images from these two sensors are pooled in the same dataset. Lets create a chart using the MSI instrument dataset we have already imported.
```js
@@ -1053,13 +1053,13 @@ Compare this Sentinel-2 graph (Fig. F1.3.16) with the Landsat graph you just pro
::: {.callout-note}
Code Checkpoint F13b. The books repository contains a script that shows what your code should look like at this point.
:::
## Spectral Resolution
### Spectral Resolution
Spectral resolution refers to the number and width of spectral bands in which the sensor takes measurements. You can think of the width of spectral bands as the wavelength intervals for each band. A sensor that measures radiance in multiple bands is called a multispectral sensor (generally 310 bands), while a sensor with many bands (possibly hundreds) is called a hyperspectral sensor.
Lets compare the multispectral MODIS instrument with the hyperspectral Hyperion sensor aboard the EO-1 satellite, which is also available in Earth Engine.
### MODIS
#### MODIS
There is an easy way to check the number of bands in an image:
```js
@@ -1113,7 +1113,7 @@ The resulting chart is shown in Fig. F1.3.17. Use the expand button in the uppe
![Fig. F1.3.17 Plot of TOA reflectance for MODIS](F1/image50.png)
### EO-1
#### EO-1
Now lets compare MODIS with the EO-1 satellites hyperspectral sensor. Search for “eo-1” and import the “EO-1 Hyperion Hyperspectral Imager” dataset. Name it eo1. We can look at the number of bands from the EO-1 sensor.
```js
@@ -1166,7 +1166,7 @@ Compare this hyperspectral instrument chart with the multispectral chart we plot
::: {.callout-note}
Code Checkpoint F13c. The books repository contains a script that shows what your code should look like at this point.
:::
## Per-Pixel Quality
### Per-Pixel Quality
As you saw above, an image consists of many bands. Some of these bands contain spectral responses of Earths surface, including the NIR, red, and green bands we examined in the Spectral Resolution section. What about the other bands? Some of these other bands contain valuable information, like pixel-by-pixel quality-control data.
@@ -1200,7 +1200,7 @@ Use the Inspector tool to examine some of the values. You may see values of 0 (
::: {.callout-note}
Code Checkpoint F13d. The books repository contains a script that shows what your code should look like at this point.
:::
## Metadata
### Metadata
In addition to band imagery and per-pixel quality flags, Earth Engine allows you to access substantial amounts of metadata associated with an image. This can all be easily printed to the Console for a single image.
@@ -1228,10 +1228,10 @@ print('MSI CLOUDY_PIXEL_PERCENTAGE:', msiCloudiness);
Code Checkpoint F13e. The books repository contains a script that shows what your code should look like at this point.
:::
## Conclusion {.unnumbered}
### Conclusion {.unnumbered}
A good understanding of the characteristics of your images is critical to your work in Earth Engine and the chapters going forward. You now know how to observe and query a variety of remote sensing datasets, and can choose among them for your work. For example, if you are interested in change detection, you might require a dataset with spectral resolution including near-infrared imagery and a fine temporal resolution. For analyses at a continental scale, you may prefer data with a coarse spatial scale, while analyses for specific forest stands may benefit from a very fine spatial scale.
## References {.unnumbered}
### References {.unnumbered}
Fisher JRB, Acosta EA, Dennedy-Frank PJ, et al (2018) Impact of satellite imagery spatial resolution on land use classification accuracy and modeled water quality. Remote Sens Ecol Conserv 4:137149. https://doi.org/10.1002/rse2.61