fixed image paths

This commit is contained in:
Ollie Ballinger
2023-04-17 11:46:07 +01:00
parent 7ccf85e48e
commit 9eb020dab7
29 changed files with 1611 additions and 1734 deletions

View File

@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Remote Sensing for OSINT - 4&nbsp; Getting Started</title>
<title>Remote Sensing for OSINT - Getting Started</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
@@ -199,20 +199,17 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Overview</span></span></a>
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Remote Sensing</span></span></a>
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Data Acquisition</span></span></a>
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
</div>
</li>
</ul>
@@ -228,26 +225,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Getting Started</span></span></a>
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Getting Started</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Interpreting Images</span></span></a>
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Image Series</span></span></a>
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">Vectors and Tables</span></span></a>
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
</div>
</li>
</ul>
@@ -263,32 +256,27 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">8</span>&nbsp; <span class="chapter-title">War at Night</span></span></a>
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">9</span>&nbsp; <span class="chapter-title">Refinery Identification</span></span></a>
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">10</span>&nbsp; <span class="chapter-title">Blast Damage Assessment</span></span></a>
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">Ship Detection</span></span></a>
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">Object Detection</span></span></a>
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
</div>
</li>
</ul>
@@ -303,44 +291,44 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<h2 id="toc-title">Table of contents</h2>
<ul>
<li><a href="#programming-basics" id="toc-programming-basics" class="nav-link active" data-scroll-target="#programming-basics"><span class="header-section-number">4.1</span> Programming Basics</a>
<li><a href="#programming-basics" id="toc-programming-basics" class="nav-link active" data-scroll-target="#programming-basics">Programming Basics</a>
<ul class="collapse">
<li><a href="#getting-started-in-the-code-editor" id="toc-getting-started-in-the-code-editor" class="nav-link" data-scroll-target="#getting-started-in-the-code-editor"><span class="header-section-number">4.1.1</span> Getting Started in the Code Editor</a></li>
<li><a href="#javascript-basics" id="toc-javascript-basics" class="nav-link" data-scroll-target="#javascript-basics"><span class="header-section-number">4.1.2</span> JavaScript Basics</a></li>
<li><a href="#earth-engine-api-basics" id="toc-earth-engine-api-basics" class="nav-link" data-scroll-target="#earth-engine-api-basics"><span class="header-section-number">4.1.3</span> Earth Engine API Basics</a></li>
<li><a href="#getting-started-in-the-code-editor" id="toc-getting-started-in-the-code-editor" class="nav-link" data-scroll-target="#getting-started-in-the-code-editor">Getting Started in the Code Editor</a></li>
<li><a href="#javascript-basics" id="toc-javascript-basics" class="nav-link" data-scroll-target="#javascript-basics">JavaScript Basics</a></li>
<li><a href="#earth-engine-api-basics" id="toc-earth-engine-api-basics" class="nav-link" data-scroll-target="#earth-engine-api-basics">Earth Engine API Basics</a></li>
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
</ul></li>
<li><a href="#exploring-images" id="toc-exploring-images" class="nav-link" data-scroll-target="#exploring-images"><span class="header-section-number">4.2</span> Exploring Images</a>
<li><a href="#exploring-images" id="toc-exploring-images" class="nav-link" data-scroll-target="#exploring-images">Exploring Images</a>
<ul class="collapse">
<li><a href="#accessing-an-image" id="toc-accessing-an-image" class="nav-link" data-scroll-target="#accessing-an-image"><span class="header-section-number">4.2.1</span> Accessing an Image</a></li>
<li><a href="#visualizing-an-image" id="toc-visualizing-an-image" class="nav-link" data-scroll-target="#visualizing-an-image"><span class="header-section-number">4.2.2</span> Visualizing an Image</a></li>
<li><a href="#true-color-composites" id="toc-true-color-composites" class="nav-link" data-scroll-target="#true-color-composites"><span class="header-section-number">4.2.3</span> True-Color Composites</a></li>
<li><a href="#false-color-composites" id="toc-false-color-composites" class="nav-link" data-scroll-target="#false-color-composites"><span class="header-section-number">4.2.4</span> False-Color Composites</a></li>
<li><a href="#attributes-of-locations" id="toc-attributes-of-locations" class="nav-link" data-scroll-target="#attributes-of-locations"><span class="header-section-number">4.2.5</span> Attributes of Locations</a></li>
<li><a href="#abstract-rgb-composites" id="toc-abstract-rgb-composites" class="nav-link" data-scroll-target="#abstract-rgb-composites"><span class="header-section-number">4.2.6</span> Abstract RGB Composites</a></li>
<li><a href="#accessing-an-image" id="toc-accessing-an-image" class="nav-link" data-scroll-target="#accessing-an-image">Accessing an Image</a></li>
<li><a href="#visualizing-an-image" id="toc-visualizing-an-image" class="nav-link" data-scroll-target="#visualizing-an-image">Visualizing an Image</a></li>
<li><a href="#true-color-composites" id="toc-true-color-composites" class="nav-link" data-scroll-target="#true-color-composites">True-Color Composites</a></li>
<li><a href="#false-color-composites" id="toc-false-color-composites" class="nav-link" data-scroll-target="#false-color-composites">False-Color Composites</a></li>
<li><a href="#attributes-of-locations" id="toc-attributes-of-locations" class="nav-link" data-scroll-target="#attributes-of-locations">Attributes of Locations</a></li>
<li><a href="#abstract-rgb-composites" id="toc-abstract-rgb-composites" class="nav-link" data-scroll-target="#abstract-rgb-composites">Abstract RGB Composites</a></li>
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
</ul></li>
<li><a href="#survey-of-raster-datasets" id="toc-survey-of-raster-datasets" class="nav-link" data-scroll-target="#survey-of-raster-datasets"><span class="header-section-number">4.3</span> Survey of Raster Datasets</a>
<li><a href="#survey-of-raster-datasets" id="toc-survey-of-raster-datasets" class="nav-link" data-scroll-target="#survey-of-raster-datasets">Survey of Raster Datasets</a>
<ul class="collapse">
<li><a href="#image-collections-an-organized-set-of-images" id="toc-image-collections-an-organized-set-of-images" class="nav-link" data-scroll-target="#image-collections-an-organized-set-of-images"><span class="header-section-number">4.3.1</span> Image Collections: An Organized Set of Images</a></li>
<li><a href="#view-an-image-collection" id="toc-view-an-image-collection" class="nav-link" data-scroll-target="#view-an-image-collection"><span class="header-section-number">4.3.2</span> View an Image Collection</a></li>
<li><a href="#filtering-image-collections" id="toc-filtering-image-collections" class="nav-link" data-scroll-target="#filtering-image-collections"><span class="header-section-number">4.3.3</span> Filtering Image Collections</a></li>
<li><a href="#collections-of-single-images" id="toc-collections-of-single-images" class="nav-link" data-scroll-target="#collections-of-single-images"><span class="header-section-number">4.3.4</span> Collections of Single Images</a></li>
<li><a href="#modis-monthly-burned-areas" id="toc-modis-monthly-burned-areas" class="nav-link" data-scroll-target="#modis-monthly-burned-areas"><span class="header-section-number">4.3.5</span> MODIS Monthly Burned Areas</a></li>
<li><a href="#methane" id="toc-methane" class="nav-link" data-scroll-target="#methane"><span class="header-section-number">4.3.6</span> Methane</a></li>
<li><a href="#global-forest-change" id="toc-global-forest-change" class="nav-link" data-scroll-target="#global-forest-change"><span class="header-section-number">4.3.7</span> Global Forest Change</a></li>
<li><a href="#digital-elevation-models" id="toc-digital-elevation-models" class="nav-link" data-scroll-target="#digital-elevation-models"><span class="header-section-number">4.3.8</span> Digital Elevation Models</a></li>
<li><a href="#image-collections-an-organized-set-of-images" id="toc-image-collections-an-organized-set-of-images" class="nav-link" data-scroll-target="#image-collections-an-organized-set-of-images">Image Collections: An Organized Set of Images</a></li>
<li><a href="#view-an-image-collection" id="toc-view-an-image-collection" class="nav-link" data-scroll-target="#view-an-image-collection">View an Image Collection</a></li>
<li><a href="#filtering-image-collections" id="toc-filtering-image-collections" class="nav-link" data-scroll-target="#filtering-image-collections">Filtering Image Collections</a></li>
<li><a href="#collections-of-single-images" id="toc-collections-of-single-images" class="nav-link" data-scroll-target="#collections-of-single-images">Collections of Single Images</a></li>
<li><a href="#modis-monthly-burned-areas" id="toc-modis-monthly-burned-areas" class="nav-link" data-scroll-target="#modis-monthly-burned-areas">MODIS Monthly Burned Areas</a></li>
<li><a href="#methane" id="toc-methane" class="nav-link" data-scroll-target="#methane">Methane</a></li>
<li><a href="#global-forest-change" id="toc-global-forest-change" class="nav-link" data-scroll-target="#global-forest-change">Global Forest Change</a></li>
<li><a href="#digital-elevation-models" id="toc-digital-elevation-models" class="nav-link" data-scroll-target="#digital-elevation-models">Digital Elevation Models</a></li>
<li><a href="#conclusion-2" id="toc-conclusion-2" class="nav-link" data-scroll-target="#conclusion-2">Conclusion</a></li>
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
</ul></li>
<li><a href="#the-remote-sensing-vocabulary" id="toc-the-remote-sensing-vocabulary" class="nav-link" data-scroll-target="#the-remote-sensing-vocabulary"><span class="header-section-number">4.4</span> The Remote Sensing Vocabulary</a>
<li><a href="#the-remote-sensing-vocabulary" id="toc-the-remote-sensing-vocabulary" class="nav-link" data-scroll-target="#the-remote-sensing-vocabulary">The Remote Sensing Vocabulary</a>
<ul class="collapse">
<li><a href="#searching-for-and-viewing-image-collection-information" id="toc-searching-for-and-viewing-image-collection-information" class="nav-link" data-scroll-target="#searching-for-and-viewing-image-collection-information"><span class="header-section-number">4.4.1</span> Searching for and Viewing Image Collection Information</a></li>
<li><a href="#spatial-resolution" id="toc-spatial-resolution" class="nav-link" data-scroll-target="#spatial-resolution"><span class="header-section-number">4.4.2</span> Spatial Resolution</a></li>
<li><a href="#temporal-resolution" id="toc-temporal-resolution" class="nav-link" data-scroll-target="#temporal-resolution"><span class="header-section-number">4.4.3</span> Temporal Resolution</a></li>
<li><a href="#spectral-resolution" id="toc-spectral-resolution" class="nav-link" data-scroll-target="#spectral-resolution"><span class="header-section-number">4.4.4</span> Spectral Resolution</a></li>
<li><a href="#per-pixel-quality" id="toc-per-pixel-quality" class="nav-link" data-scroll-target="#per-pixel-quality"><span class="header-section-number">4.4.5</span> Per-Pixel Quality</a></li>
<li><a href="#metadata" id="toc-metadata" class="nav-link" data-scroll-target="#metadata"><span class="header-section-number">4.4.6</span> Metadata</a></li>
<li><a href="#searching-for-and-viewing-image-collection-information" id="toc-searching-for-and-viewing-image-collection-information" class="nav-link" data-scroll-target="#searching-for-and-viewing-image-collection-information">Searching for and Viewing Image Collection Information</a></li>
<li><a href="#spatial-resolution" id="toc-spatial-resolution" class="nav-link" data-scroll-target="#spatial-resolution">Spatial Resolution</a></li>
<li><a href="#temporal-resolution" id="toc-temporal-resolution" class="nav-link" data-scroll-target="#temporal-resolution">Temporal Resolution</a></li>
<li><a href="#spectral-resolution" id="toc-spectral-resolution" class="nav-link" data-scroll-target="#spectral-resolution">Spectral Resolution</a></li>
<li><a href="#per-pixel-quality" id="toc-per-pixel-quality" class="nav-link" data-scroll-target="#per-pixel-quality">Per-Pixel Quality</a></li>
<li><a href="#metadata" id="toc-metadata" class="nav-link" data-scroll-target="#metadata">Metadata</a></li>
<li><a href="#conclusion-3" id="toc-conclusion-3" class="nav-link" data-scroll-target="#conclusion-3">Conclusion</a></li>
<li><a href="#references-1" id="toc-references-1" class="nav-link" data-scroll-target="#references-1">References</a></li>
</ul></li>
@@ -352,7 +340,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Getting Started</span></h1>
<h1 class="title"><span class="chapter-title">Getting Started</span></h1>
</div>
@@ -367,8 +355,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
</header>
<section id="programming-basics" class="level2" data-number="4.1">
<h2 data-number="4.1" class="anchored" data-anchor-id="programming-basics"><span class="header-section-number">4.1</span> Programming Basics</h2>
<section id="programming-basics" class="level2">
<h2 class="anchored" data-anchor-id="programming-basics">Programming Basics</h2>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -411,13 +399,13 @@ Chapter Information
<p>An API is a way to communicate with Earth Engine servers. It allows you to specify what computation you would like to do, and then to receive the results. The API is designed so that users do not need to worry about how the computation is distributed across a cluster of machines and the results are assembled. Users of the API simply specify what needs to be done. This greatly simplifies the code by hiding the implementation detail from the users. It also makes Earth Engine very approachable for users who are not familiar with writing code.</p>
<p>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.</p>
</section>
<section id="getting-started-in-the-code-editor" class="level3" data-number="4.1.1">
<h3 data-number="4.1.1" class="anchored" data-anchor-id="getting-started-in-the-code-editor"><span class="header-section-number">4.1.1</span> Getting Started in the Code Editor</h3>
<section id="getting-started-in-the-code-editor" class="level3">
<h3 class="anchored" data-anchor-id="getting-started-in-the-code-editor">Getting Started in the Code Editor</h3>
<p>If you have not already done so, be sure to add the books code repository to the Code Editor by entering <a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&amp;sa=D&amp;source=editors&amp;ust=1670414092101269&amp;usg=AOvVaw2sJyDO_fhq1tcjG77pri7V"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&amp;sa=D&amp;source=editors&amp;ust=1670414092101852&amp;usg=AOvVaw088kfXu4o_Mp4b8DJBPYjH">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> 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 <a href="https://www.google.com/url?q=https://docs.google.com/presentation/d/1Kt6wGNoesYm__Cu3k3bnlbbyPN6m9SF4hQHK-pIDHfc/edit%23slide%3Did.g18a7b4b055d_0_624&amp;sa=D&amp;source=editors&amp;ust=1670414092102526&amp;usg=AOvVaw3ZCmkCOjrZEWqxfjRZPOCn">this link</a> for help.</p>
<p>The Code Editor is an integrated development environment for the Earth Engine JavaScript API. It offers an easy way to type, debug, run, and manage code. Once you have followed Googles documentation on registering for an Earth Engine account, you should follow the documentation to open the Code Editor. When you first visit the Code Editor, you will see a screen such as the one shown in Fig. F1.0.1.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image41.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image41.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.1 The Earth Engine Code Editor</figcaption><p></p>
</figure>
</div>
@@ -426,49 +414,49 @@ Chapter Information
<p>The line of code above uses the JavaScript print function to print the text “Hello World” to the screen. Once you enter the code, click the “Run” button. The output will be displayed on the upper right-hand panel under the Console tab (Fig. F1.0.2.).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image57.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image57.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.2 Typing and running code</figcaption><p></p>
</figure>
</div>
<p>You now know where to type your code, how to run it, and where to look for the output. You just wrote your first Earth Engine script and may want to save it. Click the “Save” button (Fig. F1.0.3).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image5.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image5.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.3 Saving a script</figcaption><p></p>
</figure>
</div>
<p>If this is your first time using the Code Editor, you will be prompted to create a home folder. This is a folder in the cloud where all your code will be saved. You can pick a name of your choice, but remember that it cannot be changed and will forever be associated with your account. A good choice for the name would be your Google Account username (Fig. F1.0.4).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image64.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image64.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.4 Creating a home folder</figcaption><p></p>
</figure>
</div>
<p>Once your home folder is created, you will be prompted to enter a new repository. A repository can help you organize and share code. Your account can have multiple repositories and each repository can have multiple scripts inside it. To get started, you can create a repository named “default” (Fig. F1.0.5).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image33.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image33.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.5 Creating a new repository</figcaption><p></p>
</figure>
</div>
<p>Finally, you will be able to save your script inside the newly created repository. Enter the name “hello_world” and click OK (Fig. F1.0.6).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image37.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image37.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.6 Saving a file</figcaption><p></p>
</figure>
</div>
<p>Once the script is saved, it will appear in the script manager panel (Fig. F1.0.7). The scripts are saved in the cloud and will always be available to you when you open the Code Editor.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image24.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image24.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.7 The script manager</figcaption><p></p>
</figure>
</div>
<p>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.</p>
</section>
<section id="javascript-basics" class="level3" data-number="4.1.2">
<h3 data-number="4.1.2" class="anchored" data-anchor-id="javascript-basics"><span class="header-section-number">4.1.2</span> JavaScript Basics</h3>
<section id="javascript-basics" class="level3">
<h3 class="anchored" data-anchor-id="javascript-basics">JavaScript Basics</h3>
<p>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.</p>
<section id="variables" class="level4 unnumbered">
<h4 class="unnumbered anchored" data-anchor-id="variables">Variables</h4>
@@ -488,7 +476,7 @@ Chapter Information
<p>If you look at the output in the Console, you will see “List” with an expander arrow (▹) next to it. Clicking on the arrow will expand the list and show you its content. You will notice that along with the four items in the list, there is a number next to each value. This is the index of each item. It allows you to refer to each item in the list using a numeric value that indicates its position in the list.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image10.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image10.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.8 A JavaScript list</figcaption><p></p>
</figure>
</div>
@@ -507,7 +495,7 @@ Chapter Information
<p>We can use multiple lines to define the object. Only when we put in the semicolon (;) is the command considered complete. The object will be printed in the Console. You can see that instead of a numeric index, each item has a label. This is known as the key and can be used to retrieve the value of an item.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image40.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image40.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.9 A JavaScript object</figcaption><p></p>
</figure>
</div>
@@ -524,13 +512,13 @@ Chapter Information
<span id="cb7-7"><a href="#cb7-7" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image54.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image54.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.10 JavaScript function output</figcaption><p></p>
</figure>
</div>
</section>
<section id="comments" class="level4 unnumbbered" data-number="4.1.2.1">
<h4 class="unnumbbered anchored" data-number="4.1.2.1" data-anchor-id="comments"><span class="header-section-number">4.1.2.1</span> Comments</h4>
<section id="comments" class="level4 unnumbbered">
<h4 class="unnumbbered anchored" data-anchor-id="comments">Comments</h4>
<p>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.</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="co">// This is a comment!</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Congratulations! You have learned enough JavaScript to be able to use the Earth Engine API. In the next section, you will see how to access and execute Earth Engine API functions using JavaScript.</p>
@@ -549,12 +537,12 @@ Note
</div>
</section>
</section>
<section id="earth-engine-api-basics" class="level3" data-number="4.1.3">
<h3 data-number="4.1.3" class="anchored" data-anchor-id="earth-engine-api-basics"><span class="header-section-number">4.1.3</span> Earth Engine API Basics</h3>
<section id="earth-engine-api-basics" class="level3">
<h3 class="anchored" data-anchor-id="earth-engine-api-basics">Earth Engine API Basics</h3>
<p>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).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image59.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image59.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.12 Earth Engine API docs</figcaption><p></p>
</figure>
</div>
@@ -565,7 +553,7 @@ Note
<p>Looking at the Docs tab, you will find a group of methods that can be called on an ee.Number. Expand it to see the various functions available to work with numbers. You will see the ee.Number function that creates an Earth Engine number object from a value. In the list of functions, there is an add function for adding two numbers. Thats what you use to add a and b.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image13.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image13.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.13 ee.Number module</figcaption><p></p>
</figure>
</div>
@@ -576,7 +564,7 @@ print(result);</p>
<p>Heres another example to drive this point home. Lets say you are working on a task that requires you to create a list of years from 1980 to 2020 with a five-year interval. If you are faced with this task, the first step is to switch to the Docs tab and open the ee.List module. Browse through the functions and see if there are any functions that can help. You will notice a function ee.List.sequence. Clicking on it will bring up the documentation of the function.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image65.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image65.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.14 The ee.List.sequence function</figcaption><p></p>
</figure>
</div>
@@ -586,7 +574,7 @@ print(result);</p>
<p>The output printed in the Console will show that the variable yearList indeed contains the list of years with the correct interval.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image29.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image29.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.0.15 Output of ee.List.sequence function</figcaption><p></p>
</figure>
</div>
@@ -610,8 +598,8 @@ Note
<p>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.</p>
</section>
</section>
<section id="exploring-images" class="level2" data-number="4.2">
<h2 data-number="4.2" class="anchored" data-anchor-id="exploring-images"><span class="header-section-number">4.2</span> Exploring Images</h2>
<section id="exploring-images" class="level2">
<h2 class="anchored" data-anchor-id="exploring-images">Exploring Images</h2>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -648,8 +636,8 @@ Chapter Information
</section>
</div>
</div>
<section id="accessing-an-image" class="level3" data-number="4.2.1">
<h3 data-number="4.2.1" class="anchored" data-anchor-id="accessing-an-image"><span class="header-section-number">4.2.1</span> Accessing an Image</h3>
<section id="accessing-an-image" class="level3">
<h3 class="anchored" data-anchor-id="accessing-an-image">Accessing an Image</h3>
<p>If you have not already done so, be sure to add the books code repository to the Code Editor by entering <a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&amp;sa=D&amp;source=editors&amp;ust=1670414092189999&amp;usg=AOvVaw1jWHeBmeq93I_lo_9useCA"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&amp;sa=D&amp;source=editors&amp;ust=1670414092190705&amp;usg=AOvVaw3Z7cK8r6eOSYUceNjA8oUg">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> 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 <a href="https://www.google.com/url?q=https://docs.google.com/presentation/d/1Kt6wGNoesYm__Cu3k3bnlbbyPN6m9SF4hQHK-pIDHfc/edit%23slide%3Did.g18a7b4b055d_0_624&amp;sa=D&amp;source=editors&amp;ust=1670414092191415&amp;usg=AOvVaw2eETuRpR5worezkj7citx6">this link</a> for help.</p>
<p>To begin, you will construct an image with the Code Editor. In the sections that follow, you will see code in a distinct font and with shaded background. As you encounter code, paste it into the center panel of the Code Editor and click Run.</p>
<p>First, copy and paste the following:</p>
@@ -660,15 +648,15 @@ Chapter Information
<p>In the Console panel, you may need to click the expander arrows to show the information. You should be able to read that this image consists of 19 different bands. For each band, the metadata lists four properties, but for now lets simply note that the first property is a name or label for the band enclosed in quotation marks. For example, the name of the first band is “SR_B1” (Fig. F1.1.1).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image66.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image66.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.1 Image metadata printed to Console panel</figcaption><p></p>
</figure>
</div>
<p>A satellite sensor like Landsat 5 measures the magnitude of radiation in different portions of the electromagnetic spectrum. The first six bands in our image (“SR_B1” through “SR_B7”) contain measurements for six different portions of the spectrum. The first three bands measure visible portions of the spectrum, or quantities of blue, green, and red light. The other three bands measure infrared portions of the spectrum that are not visible to the human eye.</p>
<p>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.</p>
</section>
<section id="visualizing-an-image" class="level3" data-number="4.2.2">
<h3 data-number="4.2.2" class="anchored" data-anchor-id="visualizing-an-image"><span class="header-section-number">4.2.2</span> Visualizing an Image</h3>
<section id="visualizing-an-image" class="level3">
<h3 class="anchored" data-anchor-id="visualizing-an-image">Visualizing an Image</h3>
<p>Now lets add one of the bands to the map as a layer so that we can see it.</p>
<div class="sourceCode" id="cb13"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(first_image<span class="op">,</span> <span class="co">// dataset to display </span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> {<span class="dt">bands</span><span class="op">:</span> [<span class="st">'SR_B1'</span>]<span class="op">,</span> <span class="co">// band to display </span></span>
@@ -688,7 +676,7 @@ Chapter Information
<p>Lets explore this image with the Inspector tool. When you click on the Inspector tab on the right side of the Code Editor (Fig. F1.1.2, area A), your cursor should now look like crosshairs. When you click on a location in the image, the Inspector panel will report data for that location under three categories as follows:</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image69.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image69.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.2 Image data reported through the Inspector panel</figcaption><p></p>
</figure>
</div>
@@ -720,7 +708,7 @@ Chapter Information
<p>In the code above, notice that we included two additional parameters to the Map.addLayer call. One parameter controls whether or not the layer is shown on the screen when the layer is drawn. It may be either 1 (shown) or 0 (not shown). The other parameter defines the opacity of the layer, or your ability to “see through” the map layer. The opacity value can range between 0 (transparent) and 1 (opaque).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image36.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image36.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.3 Three bands from the Landsat image, drawn as three different grayscale layers</figcaption><p></p>
</figure>
</div>
@@ -740,8 +728,8 @@ Note
</div>
</div>
</section>
<section id="true-color-composites" class="level3" data-number="4.2.3">
<h3 data-number="4.2.3" class="anchored" data-anchor-id="true-color-composites"><span class="header-section-number">4.2.3</span> True-Color Composites</h3>
<section id="true-color-composites" class="level3">
<h3 class="anchored" data-anchor-id="true-color-composites">True-Color Composites</h3>
<p>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?</p>
<p>We can use color to compare these visual differences in the pixel values of each band layer all at once as an RGB composite. This method uses the three primary colors (red, green, and blue) to display each pixels values across three bands.</p>
<p>To try this, add this code and run it.</p>
@@ -754,13 +742,13 @@ Note
<p>The result (Fig. F1.1.4) looks like the world we see, and is referred to as a natural-color composite, because it naturally pairs the spectral ranges of the image bands to display colors. Also called a true-color composite, this image shows the red spectral band with shades of red, the green band with shades of green, and the blue band with shades of blue. We specified the pairing simply through the order of the bands in the list: B3, B2, B1. Because bands 3, 2, and 1 of Landsat 5 correspond to the real-world colors of red, green, and blue, the image resembles the world that we would see outside the window of a plane or with a low-flying drone.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image39.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image39.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.4 True-color composite</figcaption><p></p>
</figure>
</div>
</section>
<section id="false-color-composites" class="level3" data-number="4.2.4">
<h3 data-number="4.2.4" class="anchored" data-anchor-id="false-color-composites"><span class="header-section-number">4.2.4</span> False-Color Composites</h3>
<section id="false-color-composites" class="level3">
<h3 class="anchored" data-anchor-id="false-color-composites">False-Color Composites</h3>
<p>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.</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>( </span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a> first_image<span class="op">,</span> </span>
@@ -771,14 +759,14 @@ Note
<p>In this false-color composite (Fig. F1.1.5), the display colors no longer pair naturally with the bands. This particular example, which is more precisely referred to as a color-infrared composite, is a scene that we could not observe with our eyes, but that you can learn to read and interpret. Its meaning can be deciphered logically by thinking through what is passed to the red, green, and blue color channels.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image21.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image21.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.5 Color-infrared image (a false-color composite)</figcaption><p></p>
</figure>
</div>
<p>Notice how the land on the northern peninsula appears bright red (Fig. F1.1.5, area A). This is because for that area, the pixel value of the first band (which is drawing the near-infrared brightness) is much higher relative to the pixel value of the other two bands. You can check this by using the Inspector tool. Try zooming into a part of the image with a red patch (Fig. F1.1.5, area B) and clicking on a pixel that appears red. Then expand the “False Color” layer in the Inspector panel (Fig. F1.1.6, area A), click the blue icon next to the layer name (Fig. F1.1.6, area B), and read the pixel value for the three bands of the composite (Fig. F1.1.6, area C). The pixel value for B4 should be much greater than for B3 or B2.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image22.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image22.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.6 Values of B4, B3, B2 bands for a pixel that appears bright red</figcaption><p></p>
</figure>
</div>
@@ -791,15 +779,15 @@ Note
<span id="cb17-5"><a href="#cb17-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">17000</span>}<span class="op">,</span> <span class="st">'Short wave false color'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image4.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image4.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.7 Shortwave infrared false-color composite</figcaption><p></p>
</figure>
</div>
<p>To compare the two false-color composites, zoom into the area shown in the two pictures of Fig. F1.1.8. You should notice that bright red locations in the left composite appear bright green in the right composite. Why do you think that is? Does the image on the right show new distinctions not seen in the image on the left? If so, what do you think they are?</p>
<p><img src="../images/F1/image25.png" class="img-fluid"></p>
<p><img src="images/F1/image25.png" class="img-fluid"></p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image8.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image8.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.8 Near-infrared versus shortwave infrared false-color composites</figcaption><p></p>
</figure>
</div>
@@ -817,8 +805,8 @@ Note
</div>
</div>
</section>
<section id="attributes-of-locations" class="level3" data-number="4.2.5">
<h3 data-number="4.2.5" class="anchored" data-anchor-id="attributes-of-locations"><span class="header-section-number">4.2.5</span> Attributes of Locations</h3>
<section id="attributes-of-locations" class="level3">
<h3 class="anchored" data-anchor-id="attributes-of-locations">Attributes of Locations</h3>
<p>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.</p>
<p>To begin, add this code to your script and run it.</p>
<div class="sourceCode" id="cb18"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> lights93 <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(<span class="st">'NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F101993'</span>)<span class="op">;</span> </span>
@@ -835,13 +823,13 @@ Note
<p>With the zoom controls on the map, you can zoom out to see the bright spot of Shanghai, the large blob of Seoul to the north and east, the darkness of North Korea except for the small dot of Pyongyang, and the dense strips of lights of Japan and the west coast of Taiwan (Fig. F1.1.10).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image34.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image34.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.10 Stable nighttime lights in 1993</figcaption><p></p>
</figure>
</div>
</section>
<section id="abstract-rgb-composites" class="level3" data-number="4.2.6">
<h3 data-number="4.2.6" class="anchored" data-anchor-id="abstract-rgb-composites"><span class="header-section-number">4.2.6</span> Abstract RGB Composites</h3>
<section id="abstract-rgb-composites" class="level3">
<h3 class="anchored" data-anchor-id="abstract-rgb-composites">Abstract RGB Composites</h3>
<p>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.</p>
<div class="sourceCode" id="cb19"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> lights03 <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(<span class="st">'NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F152003'</span>) </span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a> <span class="op">.</span><span class="fu">select</span>(<span class="st">'stable_lights'</span>)<span class="op">.</span><span class="fu">rename</span>(<span class="st">'2003'</span>)<span class="op">;</span> </span>
@@ -864,7 +852,7 @@ Note
<p>Finally, the code prints metadata to the Console and adds the layer to the map as an RGB composite using Map.addLayer. If you look at the printed metadata, you should see under the label “change image” that our image is composed of three bands, with each band named after a year. You should also notice the order of the bands in the image: 2013, 2003, 1993. This order determines the color channels used to represent each slice of time in the composite: 2013 as red, 2003 as green, and 1993 as blue (Fig. F1.1.11).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image51.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image51.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.11 RGB composite of stable nighttime lights (2013, 2003, 1993)</figcaption><p></p>
</figure>
</div>
@@ -874,14 +862,14 @@ Note
<p>In addition to urban change, the layer also shows changes in resource extraction activities that produce bright lights. Often, these activities produce lights that are stable over the span of a year (and therefore included in the “stable lights” band), but are not sustained over the span of a decade or more. For example, in the Korea Strait (between South Korea and Japan), you can see geographic shifts of fishing fleets that use bright halogen lights to attract squid and other sea creatures towards the water surface and into their nets. Bluish pixels were likely fished more heavily in 1993 and became used less frequently by 2003, while greenish pixels were likely fished more heavily in 2003 and less frequently by 2013 (Fig. F1.1.11).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image52.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image52.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.12 Large red blobs in North Dakota and Texas from fossil fuel extraction in specific years</figcaption><p></p>
</figure>
</div>
<p>Similarly, fossil fuel extraction produces nighttime lights through gas flaring. If you pan out to North America (Fig. F1.1.12), red blobs in Alberta and North Dakota and a red swath in southeastern Texas all represent places where oil and gas extraction were absent in 1993 and 2003 but booming by 2013. Pan over to the Persian Gulf and you will see changes that look like holiday lights with dots of white, red, green, and blue appearing near each other; these distinguish stable and shifting locations of oil production. Blue lights in Syria near the border with Iraq signify the abandonment of oil fields after 1993 (Fig. F1.1.13). Pan further north and you will see another “holiday lights” display from oil and gas extraction around Surgut, Russia. In many of these places, you can check for oil and gas infrastructure by zooming in to a colored spot, making the lights layer not visible, and selecting the Satellite base layer (upper right).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image48.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image48.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.1.13 Nighttime light changes in the Middle East</figcaption><p></p>
</figure>
</div>
@@ -905,8 +893,8 @@ Note
<p>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.</p>
</section>
</section>
<section id="survey-of-raster-datasets" class="level2" data-number="4.3">
<h2 data-number="4.3" class="anchored" data-anchor-id="survey-of-raster-datasets"><span class="header-section-number">4.3</span> Survey of Raster Datasets</h2>
<section id="survey-of-raster-datasets" class="level2">
<h2 class="anchored" data-anchor-id="survey-of-raster-datasets">Survey of Raster Datasets</h2>
<p>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.</p>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
@@ -944,13 +932,13 @@ Chapter Information
</section>
</div>
</div>
<section id="image-collections-an-organized-set-of-images" class="level3" data-number="4.3.1">
<h3 data-number="4.3.1" class="anchored" data-anchor-id="image-collections-an-organized-set-of-images"><span class="header-section-number">4.3.1</span> Image Collections: An Organized Set of Images</h3>
<section id="image-collections-an-organized-set-of-images" class="level3">
<h3 class="anchored" data-anchor-id="image-collections-an-organized-set-of-images">Image Collections: An Organized Set of Images</h3>
<p>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.</p>
<p>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.</p>
</section>
<section id="view-an-image-collection" class="level3" data-number="4.3.2">
<h3 data-number="4.3.2" class="anchored" data-anchor-id="view-an-image-collection"><span class="header-section-number">4.3.2</span> View an Image Collection</h3>
<section id="view-an-image-collection" class="level3">
<h3 class="anchored" data-anchor-id="view-an-image-collection">View an Image Collection</h3>
<p>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 Earths 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.</p>
<div class="sourceCode" id="cb20"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
<span id="cb20-2"><a href="#cb20-2" aria-hidden="true" tabindex="-1"></a><span class="co">// View an Image Collection </span></span>
@@ -981,7 +969,7 @@ Chapter Information
<p>First, lets examine the map output (Fig. F1.2.1).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image18.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image18.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.1 USGS Landsat 8 Collection 2 Tier 1 Raw Scenes collection</figcaption><p></p>
</figure>
</div>
@@ -989,14 +977,14 @@ Chapter Information
<p>Now examine the printed size on the Console. It will indicate that there are more than a million images in the dataset (Fig. F1.2.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. F1.2.1 might look slightly different on your map because of this.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image9.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image9.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.2 Size of the entire Landsat 8 collection. Note that this number is constantly growing.</figcaption><p></p>
</figure>
</div>
<p>Note that printing the ImageCollection returned an error message (Fig. F1.2.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 dont want to see a million image names printed to the Console!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image71.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image71.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.3. Error encountered when trying to print the names and information to the screen for too many elements</figcaption><p></p>
</figure>
</div>
@@ -1015,11 +1003,11 @@ Note
</div>
<p>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.</p>
</section>
<section id="filtering-image-collections" class="level3" data-number="4.3.3">
<h3 data-number="4.3.3" class="anchored" data-anchor-id="filtering-image-collections"><span class="header-section-number">4.3.3</span> Filtering Image Collections</h3>
<section id="filtering-image-collections" class="level3">
<h3 class="anchored" data-anchor-id="filtering-image-collections">Filtering Image Collections</h3>
<p>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.</p>
<section id="filter-by-date" class="level4" data-number="4.3.3.1">
<h4 data-number="4.3.3.1" class="anchored" data-anchor-id="filter-by-date"><span class="header-section-number">4.3.3.1</span> Filter by Date</h4>
<section id="filter-by-date" class="level4">
<h4 class="anchored" data-anchor-id="filter-by-date">Filter by Date</h4>
<p>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):</p>
<div class="sourceCode" id="cb21"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
<span id="cb21-2"><a href="#cb21-2" aria-hidden="true" tabindex="-1"></a><span class="co">// Filter an Image Collection </span></span>
@@ -1039,14 +1027,14 @@ Note
<p>Examine the mapped landsatWinter (Fig. F1.2.4). As described in the previous chapter, 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.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image38.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image38.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.4 Landsat 8 Winter Collection</figcaption><p></p>
</figure>
</div>
<p>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.</p>
</section>
<section id="filter-by-location" class="level4" data-number="4.3.3.2">
<h4 data-number="4.3.3.2" class="anchored" data-anchor-id="filter-by-location"><span class="header-section-number">4.3.3.2</span> Filter by Location</h4>
<section id="filter-by-location" class="level4">
<h4 class="anchored" data-anchor-id="filter-by-location">Filter by Location</h4>
<p>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.</p>
<div class="sourceCode" id="cb22"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Create an Earth Engine Point object. </span></span>
<span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> pointMN <span class="op">=</span> ee<span class="op">.</span><span class="at">Geometry</span><span class="op">.</span><span class="fu">Point</span>([<span class="op">-</span><span class="fl">93.79</span><span class="op">,</span> <span class="fl">45.05</span>])<span class="op">;</span> </span>
@@ -1068,14 +1056,14 @@ Note
<p>If we uncheck the Winter Landsat 8 layer under Layers, we can see that only images that intersect our point have been selected (Fig. F1.2.5). Zoom in or out as needed. Note the printed size of the Minneapolis winter collection—we only have seven images.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image62.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image62.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.5 Minneapolis Winter Collection filtered by bounds.</figcaption><p></p>
</figure>
</div>
<p>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.</p>
</section>
<section id="selecting-the-first-image" class="level4" data-number="4.3.3.3">
<h4 data-number="4.3.3.3" class="anchored" data-anchor-id="selecting-the-first-image"><span class="header-section-number">4.3.3.3</span> Selecting the First Image</h4>
<section id="selecting-the-first-image" class="level4">
<h4 class="anchored" data-anchor-id="selecting-the-first-image">Selecting the First Image</h4>
<p>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.</p>
<div class="sourceCode" id="cb23"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Select the first image in the filtered collection. </span></span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> landsatFirst <span class="op">=</span> landsatMN<span class="op">.</span><span class="fu">first</span>()<span class="op">;</span> </span>
@@ -1091,7 +1079,7 @@ Note
<p>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. F1.2.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).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image43.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image43.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.6 First Landsat image from the filtered set</figcaption><p></p>
</figure>
</div>
@@ -1111,8 +1099,8 @@ Note
<p>Now that we have the tools to examine different image collections, we will explore other datasets.</p>
</section>
</section>
<section id="collections-of-single-images" class="level3" data-number="4.3.4">
<h3 data-number="4.3.4" class="anchored" data-anchor-id="collections-of-single-images"><span class="header-section-number">4.3.4</span> Collections of Single Images</h3>
<section id="collections-of-single-images" class="level3">
<h3 class="anchored" data-anchor-id="collections-of-single-images">Collections of Single Images</h3>
<p>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.</p>
<p>Among the most prominent of these is the ImageCollection meant to minimize the effect of the atmosphere between Earths 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 satellites view: by affecting the amount of sunlight that strikes the Earth, and by altering electromagnetic energy on its trip from its reflection at Earths surface to the satellites receptors.</p>
<p>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 Earths surface to downward radiance at the Earths surface, imitating what the sensor would have seen if it were hovering a few feet above the ground.</p>
@@ -1135,7 +1123,7 @@ Note
<span id="cb24-16"><a href="#cb24-16" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'Landsat 8 Surface Reflectance image'</span><span class="op">,</span> landsat8SRimage)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image30.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image30.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.7 Landsat 8 Surface Reflectance image bands and date</figcaption><p></p>
</figure>
</div>
@@ -1151,7 +1139,7 @@ Note
<span id="cb25-9"><a href="#cb25-9" aria-hidden="true" tabindex="-1"></a> <span class="st">'Landsat 8 SR'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image15.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image15.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.8 Landsat 8 Surface Reflectance scene from March 18, 2014</figcaption><p></p>
</figure>
</div>
@@ -1170,8 +1158,8 @@ Note
</div>
</div>
</section>
<section id="modis-monthly-burned-areas" class="level3" data-number="4.3.5">
<h3 data-number="4.3.5" class="anchored" data-anchor-id="modis-monthly-burned-areas"><span class="header-section-number">4.3.5</span> MODIS Monthly Burned Areas</h3>
<section id="modis-monthly-burned-areas" class="level3">
<h3 class="anchored" data-anchor-id="modis-monthly-burned-areas">MODIS Monthly Burned Areas</h3>
<p>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).</p>
<p>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.</p>
<div class="sourceCode" id="cb26"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the MODIS monthly burned areas dataset. </span></span>
@@ -1185,7 +1173,7 @@ Note
<p>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. F1.2.11). Can you see where fires burned areas of California, USA? In Southern and Central Africa? Northern Australia?</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image19.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image19.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.11. MODIS Monthly Burn image over California</figcaption><p></p>
</figure>
</div>
@@ -1204,8 +1192,8 @@ Note
</div>
<p>Save your script and start a new one by refreshing the page.</p>
</section>
<section id="methane" class="level3" data-number="4.3.6">
<h3 data-number="4.3.6" class="anchored" data-anchor-id="methane"><span class="header-section-number">4.3.6</span> Methane</h3>
<section id="methane" class="level3">
<h3 class="anchored" data-anchor-id="methane">Methane</h3>
<p>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.</p>
<p>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. F1.1) 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</p>
<p>between will have the color in the order outlined by the palette parameter (a list of string colors: blue, purple, cyan, green, yellow, red).</p>
@@ -1236,13 +1224,13 @@ Note
<p>Notice the different levels of methane over the African continent (Fig. F1.2.12).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image56.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image56.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.12. Methane levels over the African continent on November 28, 2018</figcaption><p></p>
</figure>
</div>
</section>
<section id="global-forest-change" class="level3" data-number="4.3.7">
<h3 data-number="4.3.7" class="anchored" data-anchor-id="global-forest-change"><span class="header-section-number">4.3.7</span> Global Forest Change</h3>
<section id="global-forest-change" class="level3">
<h3 class="anchored" data-anchor-id="global-forest-change">Global Forest Change</h3>
<p>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.</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the Hansen Global Forest Change dataset. </span></span>
<span id="cb28-2"><a href="#cb28-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> globalForest <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>( <span class="st">'UMD/hansen/global_forest_change_2020_v1_8'</span>)<span class="op">;</span> </span>
@@ -1260,7 +1248,7 @@ Note
<p>Notice how areas with high tree cover (e.g., the Amazon) are greener and areas with low tree cover are darker (Fig. F1.2.15). In case you see an error on the Console such as “Cannot read properties of null,” dont worry. Sometimes Earth Engine will show these transient errors, but they wont affect the script in any way.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image68.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image68.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.15 Global Forest Change 2000 tree cover layer</figcaption><p></p>
</figure>
</div>
@@ -1278,7 +1266,7 @@ Note
<p>Leave the previous 2000 tree cover layer checked and analyze the loss layer on top of it—yellow, orange, and red areas (Fig. F1.2.16). Pan and zoom around the map. Where has there been recent forest loss (which is shown in red)?</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image16.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image16.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.2.16 Global Forest Change 20002020 tree cover loss (yellow-red) and 2000 tree cover (black-green)</figcaption><p></p>
</figure>
</div>
@@ -1297,8 +1285,8 @@ Note
</div>
<p>Save your script and start a new one.</p>
</section>
<section id="digital-elevation-models" class="level3" data-number="4.3.8">
<h3 data-number="4.3.8" class="anchored" data-anchor-id="digital-elevation-models"><span class="header-section-number">4.3.8</span> Digital Elevation Models</h3>
<section id="digital-elevation-models" class="level3">
<h3 class="anchored" data-anchor-id="digital-elevation-models">Digital Elevation Models</h3>
<p>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.</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the NASA DEM Dataset. </span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> nasaDEM <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(<span class="st">'NASA/NASADEM_HGT/001'</span>)<span class="op">;</span> </span>
@@ -1309,7 +1297,7 @@ Note
<span id="cb30-7"><a href="#cb30-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">min</span><span class="op">:</span> <span class="dv">0</span><span class="op">,</span> </span>
<span id="cb30-8"><a href="#cb30-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">3000</span>}<span class="op">,</span> <span class="st">'NASA DEM'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Uncheck the population layer and zoom in to examine the patterns of topography (Fig. F1.2.18). 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.</p>
<p><img src="../images/F1/image61.png" class="img-fluid"></p>
<p><img src="images/F1/image61.png" class="img-fluid"></p>
<p>Fig. F1.2.18. NASADEM elevation</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
@@ -1337,8 +1325,8 @@ Note
<p>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</p>
</section>
</section>
<section id="the-remote-sensing-vocabulary" class="level2" data-number="4.4">
<h2 data-number="4.4" class="anchored" data-anchor-id="the-remote-sensing-vocabulary"><span class="header-section-number">4.4</span> The Remote Sensing Vocabulary</h2>
<section id="the-remote-sensing-vocabulary" class="level2">
<h2 class="anchored" data-anchor-id="the-remote-sensing-vocabulary">The Remote Sensing Vocabulary</h2>
<div class="callout callout-style-default callout-tip callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -1377,19 +1365,19 @@ Chapter Information
<h3 class="unlisted unnumbered anchored" data-anchor-id="introduction-1">Introduction</h3>
<p>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.</p>
</section>
<section id="searching-for-and-viewing-image-collection-information" class="level3" data-number="4.4.1">
<h3 data-number="4.4.1" class="anchored" data-anchor-id="searching-for-and-viewing-image-collection-information"><span class="header-section-number">4.4.1</span> Searching for and Viewing Image Collection Information</h3>
<section id="searching-for-and-viewing-image-collection-information" class="level3">
<h3 class="anchored" data-anchor-id="searching-for-and-viewing-image-collection-information">Searching for and Viewing Image Collection Information</h3>
<p>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.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image67.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image67.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.1 Searching for Landsat 7 in the search bar</figcaption><p></p>
</figure>
</div>
<p>Now, click on USGS Landsat 7 Collection 2 Tier 1 Raw Scenes. A new inset window will appear (Fig. F1.3.2).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image2.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image2.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.2 Inset window with information about the Landsat 7 dataset</figcaption><p></p>
</figure>
</div>
@@ -1398,32 +1386,32 @@ Chapter Information
<p>For now, click on the small “pop out” button in the upper right corner of the window. This will open a new window with the same information (Fig. F1.3.3); you can keep this new window open and use it as a reference as you proceed.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image31.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image31.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.3 The Data Catalog page for Landsat 7 with information about the dataset</figcaption><p></p>
</figure>
</div>
<p>Switch back to your code window. Your “landsat 7 collection 2” search term should still be in the search bar. This time, click the “Enter” key or click on the search magnifying glass icon. This will open a Search results inset window (Fig. F1.3.4).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image11.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image11.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.4 Search results matching “landsat 7 collection 2”</figcaption><p></p>
</figure>
</div>
<p>This more complete search results inset window contains short descriptions about each of the datasets matching your search, to help you choose which dataset you want to use. Click on the Open in Catalog button to view these search results in the Earth Engine Data Catalog (Fig. F1.3.5). Note that you may need to click Enter in the data catalog search bar with your phrase to bring up the results in this new window.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image44.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image44.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.5 Earth Engine Data Catalog results for the “landsat 7 collection 2” search term</figcaption><p></p>
</figure>
</div>
<p>Now that we know how to view this information, lets dive into some important remote sensing terminology.</p>
</section>
<section id="spatial-resolution" class="level3" data-number="4.4.2">
<h3 data-number="4.4.2" class="anchored" data-anchor-id="spatial-resolution"><span class="header-section-number">4.4.2</span> Spatial Resolution</h3>
<section id="spatial-resolution" class="level3">
<h3 class="anchored" data-anchor-id="spatial-resolution">Spatial Resolution</h3>
<p>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.</p>
<p>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.</p>
<section id="landsat-thematic-mapper" class="level4" data-number="4.4.2.1">
<h4 data-number="4.4.2.1" class="anchored" data-anchor-id="landsat-thematic-mapper"><span class="header-section-number">4.4.2.1</span> Landsat Thematic Mapper</h4>
<section id="landsat-thematic-mapper" class="level4">
<h4 class="anchored" data-anchor-id="landsat-thematic-mapper">Landsat Thematic Mapper</h4>
<p>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).</p>
<p>When you run this code, the TM image will display. Notice how many more pixels are displayed on your screen when compared to the MODIS image.</p>
<div class="sourceCode" id="cb31"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="co">// TM </span></span>
@@ -1438,13 +1426,13 @@ Chapter Information
<span id="cb31-10"><a href="#cb31-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">100</span>}<span class="op">,</span> <span class="st">'TM'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image20.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image20.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.10 Visualizing the TM imagery from the Landsat 5 satellite</figcaption><p></p>
</figure>
</div>
</section>
<section id="sentinel-2-multispectral-instrument" class="level4" data-number="4.4.2.2">
<h4 data-number="4.4.2.2" class="anchored" data-anchor-id="sentinel-2-multispectral-instrument"><span class="header-section-number">4.4.2.2</span> Sentinel-2 MultiSpectral Instrument</h4>
<section id="sentinel-2-multispectral-instrument" class="level4">
<h4 class="anchored" data-anchor-id="sentinel-2-multispectral-instrument">Sentinel-2 MultiSpectral Instrument</h4>
<p>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.</p>
<p>Search for “Sentinel 2 MSI” in the search bar, and add the “Sentinel-2 MSI: MultiSpectral Instrument, Level-1C” dataset to your workspace. Name it msi. In this dataset, the three bands for a color-IR image are called “B8” (infrared), “B4” (red), and “B3” (green).</p>
<div class="sourceCode" id="cb32"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="co">// MSI </span></span>
@@ -1461,13 +1449,13 @@ Chapter Information
<p>Compare the Sentinel imagery with the Landsat imagery, using the opacity slider. Notice how much more detail you can see on the airport terminal and surrounding landscape. The 10 m spatial resolution means that each pixel covers approximately 100 m2 of the Earths surface, a much smaller area than the TM imagery (900 m2).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image1.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image1.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.11 Visualizing the MSI imagery</figcaption><p></p>
</figure>
</div>
</section>
<section id="national-agriculture-imagery-program-naip" class="level4" data-number="4.4.2.3">
<h4 data-number="4.4.2.3" class="anchored" data-anchor-id="national-agriculture-imagery-program-naip"><span class="header-section-number">4.4.2.3</span> National Agriculture Imagery Program (NAIP)</h4>
<section id="national-agriculture-imagery-program-naip" class="level4">
<h4 class="anchored" data-anchor-id="national-agriculture-imagery-program-naip">National Agriculture Imagery Program (NAIP)</h4>
<p>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.</p>
<p>Search for “naip” and import the data set for “NAIP: National Agriculture Imagery Program”. Name the import naip. In this dataset, the three bands for a color-IR image are called “N” (infrared), “R” (red), and “G” (green).</p>
<div class="sourceCode" id="cb33"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="co">// NAIP </span></span>
@@ -1483,7 +1471,7 @@ Chapter Information
<p>The NAIP imagery is even more spatially detailed than the Sentinel-2 MSI imagery. However, we can see that our one NAIP image doesnt totally cover the San Francisco airport. If you like, zoom out to see the boundaries of the NAIP image as we did for the Sentinel-2 MSI imagery.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image32.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image32.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.13 NAIP color-IR composite over the San Francisco airport</figcaption><p></p>
</figure>
</div>
@@ -1503,11 +1491,11 @@ Note
</div>
</section>
</section>
<section id="temporal-resolution" class="level3" data-number="4.4.3">
<h3 data-number="4.4.3" class="anchored" data-anchor-id="temporal-resolution"><span class="header-section-number">4.4.3</span> Temporal Resolution</h3>
<section id="temporal-resolution" class="level3">
<h3 class="anchored" data-anchor-id="temporal-resolution">Temporal Resolution</h3>
<p>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.</p>
<section id="landsat" class="level4" data-number="4.4.3.1">
<h4 data-number="4.4.3.1" class="anchored" data-anchor-id="landsat"><span class="header-section-number">4.4.3.1</span> Landsat</h4>
<section id="landsat" class="level4">
<h4 class="anchored" data-anchor-id="landsat">Landsat</h4>
<p>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:</p>
<div class="sourceCode" id="cb34"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
<span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a><span class="co">// Explore Temporal Resolution </span></span>
@@ -1524,7 +1512,7 @@ Note
<p>Expand the features property of the printed ImageCollection in the Console output to see a List of all the images in the collection. Observe that the date of each image is part of the filename (e.g., LANDSAT/LT05/C02/T1/LT05_044034_19870628).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image3.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image3.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.14 Landsat image name and feature properties</figcaption><p></p>
</figure>
</div>
@@ -1554,13 +1542,13 @@ Note
<p>When you print the chart, it will have a point each time an image was collected by the TM instrument (Fig. F1.3.15). In the Console, you can move the mouse over the different points and see more information. Also note that you can expand the chart using the button in the upper right-hand corner. We will see many more examples of charts, particularly in the chapters in Part F4.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image47.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image47.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.15 A chart showing the temporal cadence, or temporal resolution of the Landsat 5 TM instrument at the San Francisco airport</figcaption><p></p>
</figure>
</div>
</section>
<section id="sentinel-2" class="level4" data-number="4.4.3.2">
<h4 data-number="4.4.3.2" class="anchored" data-anchor-id="sentinel-2"><span class="header-section-number">4.4.3.2</span> Sentinel-2</h4>
<section id="sentinel-2" class="level4">
<h4 class="anchored" data-anchor-id="sentinel-2">Sentinel-2</h4>
<p>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.</p>
<div class="sourceCode" id="cb37"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Sentinel-2 has a 5 day revisit time. </span></span>
<span id="cb37-2"><a href="#cb37-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> msiChart <span class="op">=</span> ui<span class="op">.</span><span class="at">Chart</span><span class="op">.</span><span class="at">image</span><span class="op">.</span><span class="fu">series</span>({ </span>
@@ -1575,7 +1563,7 @@ Note
<span id="cb37-11"><a href="#cb37-11" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'MSI Chart'</span><span class="op">,</span> msiChart)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image60.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image60.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.16 A chart showing the t temporal resolution of the Sentinel-2 MSI instrument at the San Francisco airport</figcaption><p></p>
</figure>
</div>
@@ -1595,12 +1583,12 @@ Note
</div>
</section>
</section>
<section id="spectral-resolution" class="level3" data-number="4.4.4">
<h3 data-number="4.4.4" class="anchored" data-anchor-id="spectral-resolution"><span class="header-section-number">4.4.4</span> Spectral Resolution</h3>
<section id="spectral-resolution" class="level3">
<h3 class="anchored" data-anchor-id="spectral-resolution">Spectral Resolution</h3>
<p>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.</p>
<p>Lets compare the multispectral MODIS instrument with the hyperspectral Hyperion sensor aboard the EO-1 satellite, which is also available in Earth Engine.</p>
<section id="modis" class="level4" data-number="4.4.4.1">
<h4 data-number="4.4.4.1" class="anchored" data-anchor-id="modis"><span class="header-section-number">4.4.4.1</span> MODIS</h4>
<section id="modis" class="level4">
<h4 class="anchored" data-anchor-id="modis">MODIS</h4>
<p>There is an easy way to check the number of bands in an image:</p>
<div class="sourceCode" id="cb38"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
<span id="cb38-2"><a href="#cb38-2" aria-hidden="true" tabindex="-1"></a><span class="co">// Explore spectral resolution </span></span>
@@ -1644,13 +1632,13 @@ Note
<p>The resulting chart is shown in Fig. F1.3.17. Use the expand button in the upper right to see a larger version of the chart than the one printed to the Console.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image50.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image50.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.17 Plot of TOA reflectance for MODIS</figcaption><p></p>
</figure>
</div>
</section>
<section id="eo-1" class="level4" data-number="4.4.4.2">
<h4 data-number="4.4.4.2" class="anchored" data-anchor-id="eo-1"><span class="header-section-number">4.4.4.2</span> EO-1</h4>
<section id="eo-1" class="level4">
<h4 class="anchored" data-anchor-id="eo-1">EO-1</h4>
<p>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.</p>
<div class="sourceCode" id="cb42"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Get the EO-1 band names as a ee.List </span></span>
<span id="cb42-2"><a href="#cb42-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> eo1Image <span class="op">=</span> eo1 <span class="op">.</span><span class="fu">filterDate</span>(<span class="st">'2015-01-01'</span><span class="op">,</span> <span class="st">'2016-01-01'</span>) </span>
@@ -1686,14 +1674,14 @@ Note
<p>The resulting chart is seen in Fig. F1.3.18. There are so many bands that their names only appear as “…”!</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image23.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image23.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.18 Plot of TOA reflectance for EO-1 as displayed in the Console. Note the button to expand the plot in the upper right hand corner.</figcaption><p></p>
</figure>
</div>
<p>If we click on the expand icon in the top right corner of the chart, its a little easier to see the band identifiers, as shown in Fig. F1.3.19.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="../images/F1/image70.png" class="img-fluid figure-img"></p>
<p><img src="images/F1/image70.png" class="img-fluid figure-img"></p>
<p></p><figcaption class="figure-caption">Fig. F1.3.19 Expanded plot of TOA reflectance for EO-1</figcaption><p></p>
</figure>
</div>
@@ -1713,8 +1701,8 @@ Note
</div>
</section>
</section>
<section id="per-pixel-quality" class="level3" data-number="4.4.5">
<h3 data-number="4.4.5" class="anchored" data-anchor-id="per-pixel-quality"><span class="header-section-number">4.4.5</span> Per-Pixel Quality</h3>
<section id="per-pixel-quality" class="level3">
<h3 class="anchored" data-anchor-id="per-pixel-quality">Per-Pixel Quality</h3>
<p>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.</p>
<p>For example, Sentinel-2 has a QA60 band, which contains the surface reflectance quality assurance information. Lets map it to inspect the values.</p>
<div class="sourceCode" id="cb44"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
@@ -1753,8 +1741,8 @@ Note
</div>
</div>
</section>
<section id="metadata" class="level3" data-number="4.4.6">
<h3 data-number="4.4.6" class="anchored" data-anchor-id="metadata"><span class="header-section-number">4.4.6</span> Metadata</h3>
<section id="metadata" class="level3">
<h3 class="anchored" data-anchor-id="metadata">Metadata</h3>
<p>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.</p>
<p>Lets examine the metadata for the Sentinel-2 MSI.</p>
<div class="sourceCode" id="cb45"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
@@ -1762,7 +1750,7 @@ Note
<span id="cb45-3"><a href="#cb45-3" aria-hidden="true" tabindex="-1"></a><span class="co">///// </span></span>
<span id="cb45-4"><a href="#cb45-4" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'MSI Image Metadata'</span><span class="op">,</span> msiImage)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>Examine the object youve created in the Console (Fig. F1.3.20). Expand the image name, then the properties object.</p>
<p><img src="../images/F1/image35.png" class="img-fluid"></p>
<p><img src="images/F1/image35.png" class="img-fluid"></p>
<p>Fig. F1.3.20 Checking the “CLOUDY_PIXEL_PERCENTAGE” property in the metadata for Sentinel-2</p>
<p>The first entry is the CLOUDY_PIXEL_PERCENTAGE information. Distinct from the cloudiness flag attached to every pixel, this is an image-level summary assessment of the overall cloudiness in the image. In addition to viewing the value, you might find it useful to print it to the screen, for example, or to record a list of cloudiness values in a set of images. Metadata properties can be extracted from an images properties using the get function, and printed to the Console.</p>
<div class="sourceCode" id="cb46"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Image-level Cloud info </span></span>
@@ -2147,12 +2135,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./A3_Data_Acquisition.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Data Acquisition</span></span>
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Data Acquisition</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./B2_Interpreting_Images.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Interpreting Images</span></span> <i class="bi bi-arrow-right-short"></i>
<span class="nav-page-text"><span class="chapter-title">Interpreting Images</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>