full draft

This commit is contained in:
Ollie Ballinger
2023-03-15 18:41:58 +00:00
parent 46b6ba63c3
commit 53e859f6d7
114 changed files with 4735 additions and 13248 deletions

View File

@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Google Earth Engine for OSINT - 3&nbsp; Getting Started</title>
<title>Remote Sensing for OSINT - 1&nbsp; Getting Started</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
@@ -146,7 +146,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<header id="quarto-header" class="headroom fixed-top">
<nav class="quarto-secondary-nav" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<div class="container-fluid d-flex justify-content-between">
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Getting Started</span></h1>
<h1 class="quarto-secondary-nav-title"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></h1>
<button type="button" class="quarto-btn-toggle btn" aria-label="Show secondary navigation">
<i class="bi bi-chevron-right"></i>
</button>
@@ -162,19 +162,21 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<img src="./logo_white.png" alt="" class="sidebar-logo py-0 d-lg-inline d-none">
</a>
<div class="sidebar-title mb-0 py-0">
<a href="./">Google Earth Engine for OSINT</a>
<a href="./">Remote Sensing for OSINT</a>
<div class="sidebar-tools-main tools-wide">
<a href="https://github.com/oballinger/GEE_OSINT/" title="Source Code" class="sidebar-tool px-1"><i class="bi bi-github"></i></a>
<a href="" title="Download" id="sidebar-tool-dropdown-0" class="sidebar-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-download"></i></a>
<ul class="dropdown-menu" aria-labelledby="sidebar-tool-dropdown-0">
<li>
<a class="dropdown-item sidebar-tools-main-item" href="./Google-Earth-Engine-for-OSINT.pdf">
<a class="dropdown-item sidebar-tools-main-item" href="./Remote-Sensing-
-for-OSINT.pdf">
<i class="bi bi-bi-file-pdf pe-1"></i>
Download PDF
</a>
</li>
<li>
<a class="dropdown-item sidebar-tools-main-item" href="./Google-Earth-Engine-for-OSINT.epub">
<a class="dropdown-item sidebar-tools-main-item" href="./Remote-Sensing-
-for-OSINT.epub">
<i class="bi bi-bi-journal pe-1"></i>
Download ePub
</a>
@@ -206,59 +208,34 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
</div>
<div class="sidebar-menu-container">
<ul class="list-unstyled mt-1">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./index.html" class="sidebar-item-text sidebar-link">Introduction</a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">Learning</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">A. Introduction</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./ch1.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Remote Sensing</span></a>
<a href="./index.html" class="sidebar-item-text sidebar-link">Overview</a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./ch2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Data Acquisition</span></a>
<a href="./ch1.html" class="sidebar-item-text sidebar-link">Remote Sensing</a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F1.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Getting Started</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Interpreting Images</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F4.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">Interpreting Image Series</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F5.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">Vectors and Tables</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F6.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">Advanced Topics</span></a>
<a href="./ch2.html" class="sidebar-item-text sidebar-link">Data Acquisition</a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">Case Studies</a>
<a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">B. Google Earth Engine</a>
<a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true">
<i class="bi bi-chevron-right ms-2"></i>
</a>
@@ -266,6 +243,36 @@ 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="./F1.html" class="sidebar-item-text sidebar-link active"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F2.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Interpreting Images</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F4.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Image Series</span></a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./F5.html" class="sidebar-item-text sidebar-link"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">Vectors and Tables</span></a>
</div>
</li>
</ul>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">C. Case Studies</a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="false">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./lights.html" class="sidebar-item-text sidebar-link">War at Night</a>
</div>
</li>
@@ -283,6 +290,11 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
<div class="sidebar-item-container">
<a href="./blast.html" class="sidebar-item-text sidebar-link">Blast Damage Assessment</a>
</div>
</li>
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./object_detection.html" class="sidebar-item-text sidebar-link">Object Detection</a>
</div>
</li>
</ul>
</li>
@@ -295,44 +307,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="toc-section-number">3.1</span> Programming Basics</a>
<li><a href="#programming-basics" id="toc-programming-basics" class="nav-link active" data-scroll-target="#programming-basics"><span class="toc-section-number">1.1</span> 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="toc-section-number">3.1.1</span> Getting Started in&nbsp;the Code Editor</a></li>
<li><a href="#javascript-basics" id="toc-javascript-basics" class="nav-link" data-scroll-target="#javascript-basics"><span class="toc-section-number">3.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="toc-section-number">3.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"><span class="toc-section-number">1.1.1</span> Getting Started in&nbsp;the Code Editor</a></li>
<li><a href="#javascript-basics" id="toc-javascript-basics" class="nav-link" data-scroll-target="#javascript-basics"><span class="toc-section-number">1.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="toc-section-number">1.1.3</span> 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="toc-section-number">3.2</span> Exploring Images</a>
<li><a href="#exploring-images" id="toc-exploring-images" class="nav-link" data-scroll-target="#exploring-images"><span class="toc-section-number">1.2</span> 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="toc-section-number">3.2.1</span> Accessing&nbsp;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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.2.6</span> Abstract RGB Composites &nbsp;</a></li>
<li><a href="#accessing-an-image" id="toc-accessing-an-image" class="nav-link" data-scroll-target="#accessing-an-image"><span class="toc-section-number">1.2.1</span> Accessing&nbsp;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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.2.6</span> Abstract RGB Composites &nbsp;</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="toc-section-number">3.3</span> Survey&nbsp;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"><span class="toc-section-number">1.3</span> Survey&nbsp;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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.3.7</span> Global&nbsp;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="toc-section-number">3.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"><span class="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.3.7</span> Global&nbsp;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="toc-section-number">1.3.8</span> 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="toc-section-number">3.4</span> The Remote&nbsp;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"><span class="toc-section-number">1.4</span> The Remote&nbsp;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="toc-section-number">3.4.1</span> Searching&nbsp;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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.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="toc-section-number">3.4.5</span> Per-Pixel Quality</a></li>
<li><a href="#metadata" id="toc-metadata" class="nav-link" data-scroll-target="#metadata"><span class="toc-section-number">3.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"><span class="toc-section-number">1.4.1</span> Searching&nbsp;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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.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="toc-section-number">1.4.5</span> Per-Pixel Quality</a></li>
<li><a href="#metadata" id="toc-metadata" class="nav-link" data-scroll-target="#metadata"><span class="toc-section-number">1.4.6</span> 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>
@@ -344,7 +356,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 d-none d-lg-block"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Getting Started</span></h1>
<h1 class="title d-none d-lg-block"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Getting Started</span></h1>
</div>
@@ -359,8 +371,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
</header>
<section id="programming-basics" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="programming-basics"><span class="header-section-number">3.1</span> Programming Basics</h2>
<section id="programming-basics" class="level2" data-number="1.1">
<h2 data-number="1.1" class="anchored" data-anchor-id="programming-basics"><span class="header-section-number">1.1</span> Programming Basics</h2>
<div class="callout-tip callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -403,8 +415,8 @@ 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&nbsp;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="3.1.1">
<h3 data-number="3.1.1" class="anchored" data-anchor-id="getting-started-in-the-code-editor"><span class="header-section-number">3.1.1</span> Getting Started in&nbsp;the Code Editor</h3>
<section id="getting-started-in-the-code-editor" class="level3" data-number="1.1.1">
<h3 data-number="1.1.1" class="anchored" data-anchor-id="getting-started-in-the-code-editor"><span class="header-section-number">1.1.1</span> Getting Started in&nbsp;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&nbsp;<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>&nbsp;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>&nbsp;for help.</p>
<p>The Code Editor is an integrated development&nbsp;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">
@@ -459,8 +471,8 @@ Chapter Information
</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="3.1.2">
<h3 data-number="3.1.2" class="anchored" data-anchor-id="javascript-basics"><span class="header-section-number">3.1.2</span> JavaScript Basics</h3>
<section id="javascript-basics" class="level3" data-number="1.1.2">
<h3 data-number="1.1.2" class="anchored" data-anchor-id="javascript-basics"><span class="header-section-number">1.1.2</span> 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,&nbsp;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>
@@ -519,8 +531,8 @@ Chapter Information
</figure>
</div>
</section>
<section id="comments" class="level4 unnumbbered" data-number="3.1.2.1">
<h4 class="unnumbbered anchored" data-number="3.1.2.1" data-anchor-id="comments"><span class="header-section-number">3.1.2.1</span> Comments</h4>
<section id="comments" class="level4 unnumbbered" data-number="1.1.2.1">
<h4 class="unnumbbered anchored" data-number="1.1.2.1" data-anchor-id="comments"><span class="header-section-number">1.1.2.1</span> 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>
@@ -539,8 +551,8 @@ Note
</div>
</section>
</section>
<section id="earth-engine-api-basics" class="level3" data-number="3.1.3">
<h3 data-number="3.1.3" class="anchored" data-anchor-id="earth-engine-api-basics"><span class="header-section-number">3.1.3</span> Earth Engine API Basics</h3>
<section id="earth-engine-api-basics" class="level3" data-number="1.1.3">
<h3 data-number="1.1.3" class="anchored" data-anchor-id="earth-engine-api-basics"><span class="header-section-number">1.1.3</span> 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&nbsp;(for Earth Engine).</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
@@ -600,8 +612,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="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="exploring-images"><span class="header-section-number">3.2</span> Exploring Images</h2>
<section id="exploring-images" class="level2" data-number="1.2">
<h2 data-number="1.2" class="anchored" data-anchor-id="exploring-images"><span class="header-section-number">1.2</span> Exploring Images</h2>
<div class="callout-tip callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -638,8 +650,8 @@ Chapter Information
</section>
</div>
</div>
<section id="accessing-an-image" class="level3" data-number="3.2.1">
<h3 data-number="3.2.1" class="anchored" data-anchor-id="accessing-an-image"><span class="header-section-number">3.2.1</span> Accessing&nbsp;an Image</h3>
<section id="accessing-an-image" class="level3" data-number="1.2.1">
<h3 data-number="1.2.1" class="anchored" data-anchor-id="accessing-an-image"><span class="header-section-number">1.2.1</span> Accessing&nbsp;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&nbsp;<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>&nbsp;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>&nbsp;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>
@@ -657,8 +669,8 @@ Chapter Information
<p>A satellite&nbsp;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="3.2.2">
<h3 data-number="3.2.2" class="anchored" data-anchor-id="visualizing-an-image"><span class="header-section-number">3.2.2</span> Visualizing an Image</h3>
<section id="visualizing-an-image" class="level3" data-number="1.2.2">
<h3 data-number="1.2.2" class="anchored" data-anchor-id="visualizing-an-image"><span class="header-section-number">1.2.2</span> Visualizing an Image</h3>
<p>Now lets add one of the bands to the map as a layer&nbsp;so that we can see it. &nbsp;</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">// &nbsp;dataset to display&nbsp; &nbsp;</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">// &nbsp;band to display&nbsp; &nbsp; &nbsp; &nbsp;</span></span>
@@ -730,8 +742,8 @@ Note
</div>
</div>
</section>
<section id="true-color-composites" class="level3" data-number="3.2.3">
<h3 data-number="3.2.3" class="anchored" data-anchor-id="true-color-composites"><span class="header-section-number">3.2.3</span> True-Color Composites</h3>
<section id="true-color-composites" class="level3" data-number="1.2.3">
<h3 data-number="1.2.3" class="anchored" data-anchor-id="true-color-composites"><span class="header-section-number">1.2.3</span> True-Color Composites</h3>
<p>Using the controls&nbsp;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? &nbsp;</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>
@@ -749,8 +761,8 @@ Note
</figure>
</div>
</section>
<section id="false-color-composites" class="level3" data-number="3.2.4">
<h3 data-number="3.2.4" class="anchored" data-anchor-id="false-color-composites"><span class="header-section-number">3.2.4</span> False-Color Composites</h3>
<section id="false-color-composites" class="level3" data-number="1.2.4">
<h3 data-number="1.2.4" class="anchored" data-anchor-id="false-color-composites"><span class="header-section-number">1.2.4</span> False-Color Composites</h3>
<p>As you saw when you&nbsp;printed the band list&nbsp;(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. &nbsp;</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>&nbsp; &nbsp;first_image<span class="op">,</span> </span>
@@ -807,8 +819,8 @@ Note
</div>
</div>
</section>
<section id="attributes-of-locations" class="level3" data-number="3.2.5">
<h3 data-number="3.2.5" class="anchored" data-anchor-id="attributes-of-locations"><span class="header-section-number">3.2.5</span> Attributes of Locations</h3>
<section id="attributes-of-locations" class="level3" data-number="1.2.5">
<h3 data-number="1.2.5" class="anchored" data-anchor-id="attributes-of-locations"><span class="header-section-number">1.2.5</span> 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&nbsp;of geographic locations. &nbsp;</p>
<p>To begin, add this code to your script and run it. &nbsp;</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>
@@ -830,8 +842,8 @@ Note
</figure>
</div>
</section>
<section id="abstract-rgb-composites" class="level3" data-number="3.2.6">
<h3 data-number="3.2.6" class="anchored" data-anchor-id="abstract-rgb-composites"><span class="header-section-number">3.2.6</span> Abstract RGB Composites &nbsp;</h3>
<section id="abstract-rgb-composites" class="level3" data-number="1.2.6">
<h3 data-number="1.2.6" class="anchored" data-anchor-id="abstract-rgb-composites"><span class="header-section-number">1.2.6</span> Abstract RGB Composites &nbsp;</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. &nbsp;</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>var&nbsp;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>&nbsp; <span class="at">&nbsp;</span><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>
@@ -895,8 +907,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="3.3">
<h2 data-number="3.3" class="anchored" data-anchor-id="survey-of-raster-datasets"><span class="header-section-number">3.3</span> Survey&nbsp;of Raster Datasets</h2>
<section id="survey-of-raster-datasets" class="level2" data-number="1.3">
<h2 data-number="1.3" class="anchored" data-anchor-id="survey-of-raster-datasets"><span class="header-section-number">1.3</span> Survey&nbsp;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&nbsp;for the exact image characteristics needed for your analysis.</p>
<div class="callout-tip callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
@@ -934,13 +946,13 @@ Chapter Information
</section>
</div>
</div>
<section id="image-collections-an-organized-set-of-images" class="level3" data-number="3.3.1">
<h3 data-number="3.3.1" class="anchored" data-anchor-id="image-collections-an-organized-set-of-images"><span class="header-section-number">3.3.1</span> Image Collections: An Organized Set of Images</h3>
<section id="image-collections-an-organized-set-of-images" class="level3" data-number="1.3.1">
<h3 data-number="1.3.1" class="anchored" data-anchor-id="image-collections-an-organized-set-of-images"><span class="header-section-number">1.3.1</span> Image Collections: An Organized Set of Images</h3>
<p>There are many different types of image collections&nbsp;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&nbsp;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&nbsp;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&nbsp;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&nbsp;Map.addLayer.</p>
</section>
<section id="view-an-image-collection" class="level3" data-number="3.3.2">
<h3 data-number="3.3.2" class="anchored" data-anchor-id="view-an-image-collection"><span class="header-section-number">3.3.2</span> View an Image Collection</h3>
<section id="view-an-image-collection" class="level3" data-number="1.3.2">
<h3 data-number="1.3.2" class="anchored" data-anchor-id="view-an-image-collection"><span class="header-section-number">1.3.2</span> 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>
@@ -1005,11 +1017,11 @@ Note
</div>
<p>Edit&nbsp;your code to comment out the last two code commands you have written. This will remove the call to Map.addLayer&nbsp;that drew every image, and will remove the print&nbsp;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="3.3.3">
<h3 data-number="3.3.3" class="anchored" data-anchor-id="filtering-image-collections"><span class="header-section-number">3.3.3</span> Filtering Image Collections</h3>
<section id="filtering-image-collections" class="level3" data-number="1.3.3">
<h3 data-number="1.3.3" class="anchored" data-anchor-id="filtering-image-collections"><span class="header-section-number">1.3.3</span> Filtering Image Collections</h3>
<p>The ImageCollection&nbsp;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="3.3.3.1">
<h4 data-number="3.3.3.1" class="anchored" data-anchor-id="filter-by-date"><span class="header-section-number">3.3.3.1</span> Filter by Date</h4>
<section id="filter-by-date" class="level4" data-number="1.3.3.1">
<h4 data-number="1.3.3.1" class="anchored" data-anchor-id="filter-by-date"><span class="header-section-number">1.3.3.1</span> 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>
@@ -1035,8 +1047,8 @@ Note
</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="3.3.3.2">
<h4 data-number="3.3.3.2" class="anchored" data-anchor-id="filter-by-location"><span class="header-section-number">3.3.3.2</span> Filter by Location</h4>
<section id="filter-by-location" class="level4" data-number="1.3.3.2">
<h4 data-number="1.3.3.2" class="anchored" data-anchor-id="filter-by-location"><span class="header-section-number">1.3.3.2</span> Filter by Location</h4>
<p>A second frequently used filtering tool&nbsp;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&nbsp;function to add the pointMN&nbsp;to the map with an empty dictionary {}&nbsp;for the visParams&nbsp;argument.&nbsp;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>var&nbsp;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>
@@ -1064,8 +1076,8 @@ Note
</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="3.3.3.3">
<h4 data-number="3.3.3.3" class="anchored" data-anchor-id="selecting-the-first-image"><span class="header-section-number">3.3.3.3</span> Selecting the First Image</h4>
<section id="selecting-the-first-image" class="level4" data-number="1.3.3.3">
<h4 data-number="1.3.3.3" class="anchored" data-anchor-id="selecting-the-first-image"><span class="header-section-number">1.3.3.3</span> Selecting the First Image</h4>
<p>The final operation we will explore is the first&nbsp;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>var&nbsp;landsatFirst <span class="op">=</span> landsatMN<span class="op">.</span><span class="fu">first</span>()<span class="op">;</span> </span>
@@ -1101,8 +1113,8 @@ Note
<p>Now that we have the tools to examine different image collections, we will explore&nbsp;other datasets.</p>
</section>
</section>
<section id="collections-of-single-images" class="level3" data-number="3.3.4">
<h3 data-number="3.3.4" class="anchored" data-anchor-id="collections-of-single-images"><span class="header-section-number">3.3.4</span> Collections of Single Images</h3>
<section id="collections-of-single-images" class="level3" data-number="1.3.4">
<h3 data-number="1.3.4" class="anchored" data-anchor-id="collections-of-single-images"><span class="header-section-number">1.3.4</span> 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&nbsp;in Earth Engine.</p>
<p>Among the most prominent of these is the ImageCollection&nbsp;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&nbsp;the atmosphere obscures a&nbsp;satellites view:&nbsp;by affecting the amount of sunlight that strikes the Earth, and by altering electromagnetic energy&nbsp;on its trip from its reflection at Earths surface to the satellites receptors.</p>
<p>Unraveling&nbsp;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&nbsp;automatically treated with the most up-to-date atmospheric correction algorithms, producing a product referred to as a “surface reflectance” ImageCollection. The surface reflectance&nbsp;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&nbsp;above the ground. &nbsp;</p>
@@ -1160,8 +1172,8 @@ Note
</div>
</div>
</section>
<section id="modis-monthly-burned-areas" class="level3" data-number="3.3.5">
<h3 data-number="3.3.5" class="anchored" data-anchor-id="modis-monthly-burned-areas"><span class="header-section-number">3.3.5</span> MODIS Monthly Burned Areas</h3>
<section id="modis-monthly-burned-areas" class="level3" data-number="1.3.5">
<h3 data-number="1.3.5" class="anchored" data-anchor-id="modis-monthly-burned-areas"><span class="header-section-number">1.3.5</span> 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&nbsp;and Aqua&nbsp;satellites. On these complex sensors, different MODIS bands&nbsp;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>
@@ -1194,8 +1206,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="3.3.6">
<h3 data-number="3.3.6" class="anchored" data-anchor-id="methane"><span class="header-section-number">3.3.6</span> Methane</h3>
<section id="methane" class="level3" data-number="1.3.6">
<h3 data-number="1.3.6" class="anchored" data-anchor-id="methane"><span class="header-section-number">1.3.6</span> 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&nbsp;and how different objects and compounds reflect when hit with sunlight in various wavelengths. For example, methane&nbsp;(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&nbsp;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&nbsp;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&nbsp;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&nbsp;parameter (a list of string colors: blue, purple, cyan, green, yellow, red).</p>
@@ -1231,8 +1243,8 @@ Note
</figure>
</div>
</section>
<section id="global-forest-change" class="level3" data-number="3.3.7">
<h3 data-number="3.3.7" class="anchored" data-anchor-id="global-forest-change"><span class="header-section-number">3.3.7</span> Global&nbsp;Forest Change</h3>
<section id="global-forest-change" class="level3" data-number="1.3.7">
<h3 data-number="1.3.7" class="anchored" data-anchor-id="global-forest-change"><span class="header-section-number">1.3.7</span> Global&nbsp;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&nbsp;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&nbsp;instead of having its calculation done within the Map.addLayer&nbsp;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>var&nbsp;globalForest <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(&nbsp; &nbsp;<span class="st">'UMD/hansen/global_forest_change_2020_v1_8'</span>)<span class="op">;</span> </span>
@@ -1287,8 +1299,8 @@ Note
</div>
<p>Save your script and start a new one.</p>
</section>
<section id="digital-elevation-models" class="level3" data-number="3.3.8">
<h3 data-number="3.3.8" class="anchored" data-anchor-id="digital-elevation-models"><span class="header-section-number">3.3.8</span> Digital Elevation Models</h3>
<section id="digital-elevation-models" class="level3" data-number="1.3.8">
<h3 data-number="1.3.8" class="anchored" data-anchor-id="digital-elevation-models"><span class="header-section-number">1.3.8</span> 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>var&nbsp;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>
@@ -1327,8 +1339,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="3.4">
<h2 data-number="3.4" class="anchored" data-anchor-id="the-remote-sensing-vocabulary"><span class="header-section-number">3.4</span> The Remote&nbsp;Sensing Vocabulary</h2>
<section id="the-remote-sensing-vocabulary" class="level2" data-number="1.4">
<h2 data-number="1.4" class="anchored" data-anchor-id="the-remote-sensing-vocabulary"><span class="header-section-number">1.4</span> The Remote&nbsp;Sensing Vocabulary</h2>
<div class="callout-tip callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -1367,8 +1379,8 @@ 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="3.4.1">
<h3 data-number="3.4.1" class="anchored" data-anchor-id="searching-for-and-viewing-image-collection-information"><span class="header-section-number">3.4.1</span> Searching&nbsp;for and Viewing Image Collection Information</h3>
<section id="searching-for-and-viewing-image-collection-information" class="level3" data-number="1.4.1">
<h3 data-number="1.4.1" class="anchored" data-anchor-id="searching-for-and-viewing-image-collection-information"><span class="header-section-number">1.4.1</span> Searching&nbsp;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">
@@ -1408,12 +1420,12 @@ Chapter Information
</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="3.4.2">
<h3 data-number="3.4.2" class="anchored" data-anchor-id="spatial-resolution"><span class="header-section-number">3.4.2</span> Spatial Resolution</h3>
<section id="spatial-resolution" class="level3" data-number="1.4.2">
<h3 data-number="1.4.2" class="anchored" data-anchor-id="spatial-resolution"><span class="header-section-number">1.4.2</span> Spatial Resolution</h3>
<p>Spatial&nbsp;resolution&nbsp;relates to the amount of Earths surface area covered by a single pixel. For example, we typically say that Landsat&nbsp;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&nbsp;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&nbsp;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&nbsp;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="3.4.2.1">
<h4 data-number="3.4.2.1" class="anchored" data-anchor-id="landsat-thematic-mapper"><span class="header-section-number">3.4.2.1</span> Landsat Thematic Mapper</h4>
<section id="landsat-thematic-mapper" class="level4" data-number="1.4.2.1">
<h4 data-number="1.4.2.1" class="anchored" data-anchor-id="landsat-thematic-mapper"><span class="header-section-number">1.4.2.1</span> 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&nbsp;braces in the Map.addLayer&nbsp;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>
@@ -1433,8 +1445,8 @@ Chapter Information
</figure>
</div>
</section>
<section id="sentinel-2-multispectral-instrument" class="level4" data-number="3.4.2.2">
<h4 data-number="3.4.2.2" class="anchored" data-anchor-id="sentinel-2-multispectral-instrument"><span class="header-section-number">3.4.2.2</span> Sentinel-2 MultiSpectral Instrument</h4>
<section id="sentinel-2-multispectral-instrument" class="level4" data-number="1.4.2.2">
<h4 data-number="1.4.2.2" class="anchored" data-anchor-id="sentinel-2-multispectral-instrument"><span class="header-section-number">1.4.2.2</span> 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>
@@ -1456,8 +1468,8 @@ Chapter Information
</figure>
</div>
</section>
<section id="national-agriculture-imagery-program-naip" class="level4" data-number="3.4.2.3">
<h4 data-number="3.4.2.3" class="anchored" data-anchor-id="national-agriculture-imagery-program-naip"><span class="header-section-number">3.4.2.3</span> National Agriculture Imagery Program (NAIP)</h4>
<section id="national-agriculture-imagery-program-naip" class="level4" data-number="1.4.2.3">
<h4 data-number="1.4.2.3" class="anchored" data-anchor-id="national-agriculture-imagery-program-naip"><span class="header-section-number">1.4.2.3</span> 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. &nbsp;</p>
<p>Search for “naip” and import the data set for “NAIP: National Agriculture Imagery Program”. &nbsp;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>
@@ -1493,11 +1505,11 @@ Note
</div>
</section>
</section>
<section id="temporal-resolution" class="level3" data-number="3.4.3">
<h3 data-number="3.4.3" class="anchored" data-anchor-id="temporal-resolution"><span class="header-section-number">3.4.3</span> Temporal Resolution</h3>
<section id="temporal-resolution" class="level3" data-number="1.4.3">
<h3 data-number="1.4.3" class="anchored" data-anchor-id="temporal-resolution"><span class="header-section-number">1.4.3</span> Temporal Resolution</h3>
<p>Temporal resolution&nbsp;refers to the revisit time, or temporal cadence&nbsp;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="3.4.3.1">
<h4 data-number="3.4.3.1" class="anchored" data-anchor-id="landsat"><span class="header-section-number">3.4.3.1</span> Landsat</h4>
<section id="landsat" class="level4" data-number="1.4.3.1">
<h4 data-number="1.4.3.1" class="anchored" data-anchor-id="landsat"><span class="header-section-number">1.4.3.1</span> Landsat</h4>
<p>The Landsat satellites 5 and later are able to image a given location every 16 days. Lets use our existing tm&nbsp;dataset from Landsat 5. To see the time series of images at a location, you can filter an ImageCollection&nbsp;to an area and date range of interest&nbsp;and then print&nbsp;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>
@@ -1549,8 +1561,8 @@ Note
</figure>
</div>
</section>
<section id="sentinel-2" class="level4" data-number="3.4.3.2">
<h4 data-number="3.4.3.2" class="anchored" data-anchor-id="sentinel-2"><span class="header-section-number">3.4.3.2</span> Sentinel-2</h4>
<section id="sentinel-2" class="level4" data-number="1.4.3.2">
<h4 data-number="1.4.3.2" class="anchored" data-anchor-id="sentinel-2"><span class="header-section-number">1.4.3.2</span> 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>var&nbsp;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>
@@ -1585,12 +1597,12 @@ Note
</div>
</section>
</section>
<section id="spectral-resolution" class="level3" data-number="3.4.4">
<h3 data-number="3.4.4" class="anchored" data-anchor-id="spectral-resolution"><span class="header-section-number">3.4.4</span> Spectral Resolution</h3>
<section id="spectral-resolution" class="level3" data-number="1.4.4">
<h3 data-number="1.4.4" class="anchored" data-anchor-id="spectral-resolution"><span class="header-section-number">1.4.4</span> Spectral Resolution</h3>
<p>Spectral resolution&nbsp;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&nbsp;sensor&nbsp;(generally 310 bands), while a sensor with many bands (possibly hundreds) is called a hyperspectral&nbsp;sensor.</p>
<p>Lets compare the multispectral MODIS instrument with the hyperspectral Hyperion&nbsp;sensor aboard the EO-1 satellite, which is also available in Earth Engine.</p>
<section id="modis" class="level4" data-number="3.4.4.1">
<h4 data-number="3.4.4.1" class="anchored" data-anchor-id="modis"><span class="header-section-number">3.4.4.1</span> MODIS</h4>
<section id="modis" class="level4" data-number="1.4.4.1">
<h4 data-number="1.4.4.1" class="anchored" data-anchor-id="modis"><span class="header-section-number">1.4.4.1</span> 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>
@@ -1639,8 +1651,8 @@ Note
</figure>
</div>
</section>
<section id="eo-1" class="level4" data-number="3.4.4.2">
<h4 data-number="3.4.4.2" class="anchored" data-anchor-id="eo-1"><span class="header-section-number">3.4.4.2</span> EO-1</h4>
<section id="eo-1" class="level4" data-number="1.4.4.2">
<h4 data-number="1.4.4.2" class="anchored" data-anchor-id="eo-1"><span class="header-section-number">1.4.4.2</span> 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>var&nbsp;eo1Image <span class="op">=</span> eo1&nbsp; <span class="at">&nbsp;</span><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>
@@ -1703,8 +1715,8 @@ Note
</div>
</section>
</section>
<section id="per-pixel-quality" class="level3" data-number="3.4.5">
<h3 data-number="3.4.5" class="anchored" data-anchor-id="per-pixel-quality"><span class="header-section-number">3.4.5</span> Per-Pixel Quality</h3>
<section id="per-pixel-quality" class="level3" data-number="1.4.5">
<h3 data-number="1.4.5" class="anchored" data-anchor-id="per-pixel-quality"><span class="header-section-number">1.4.5</span> 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&nbsp;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>
@@ -1743,21 +1755,22 @@ Note
</div>
</div>
</section>
<section id="metadata" class="level3" data-number="3.4.6">
<h3 data-number="3.4.6" class="anchored" data-anchor-id="metadata"><span class="header-section-number">3.4.6</span> Metadata</h3>
<section id="metadata" class="level3" data-number="1.4.6">
<h3 data-number="1.4.6" class="anchored" data-anchor-id="metadata"><span class="header-section-number">1.4.6</span> 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&nbsp;for a single image.</p>
<p>Lets examine the metadata for the Sentinel-2 MSI.</p>
<p>/////<br>
// Metadata<br>
/////<br>
print(MSI Image Metadata, msiImage);</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>
<span id="cb45-2"><a href="#cb45-2" aria-hidden="true" tabindex="-1"></a><span class="co">// Metadata </span></span>
<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&nbsp;object.</p>
<p><img src="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&nbsp;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&nbsp;print it to the screen, for example, or to record a list of cloudiness values in a set of images. Metadata properties can&nbsp;be extracted from an images properties using the get&nbsp;function, and printed to the Console.</p>
<p>// Image-level Cloud info<br>
var msiCloudiness = msiImage.get(CLOUDY_PIXEL_PERCENTAGE);</p>
<p>print(MSI CLOUDY_PIXEL_PERCENTAGE:, msiCloudiness);</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>
<span id="cb46-2"><a href="#cb46-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> msiCloudiness <span class="op">=</span> msiImage<span class="op">.</span><span class="fu">get</span>(<span class="st">'CLOUDY_PIXEL_PERCENTAGE'</span>)<span class="op">;</span> </span>
<span id="cb46-3"><a href="#cb46-3" aria-hidden="true" tabindex="-1"></a> </span>
<span id="cb46-4"><a href="#cb46-4" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'MSI CLOUDY_PIXEL_PERCENTAGE:'</span><span class="op">,</span> msiCloudiness)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="callout-note callout callout-style-default callout-captioned">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
@@ -2036,12 +2049,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./ch2.html" class="pagination-link">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">Data Acquisition</span></span>
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">Data Acquisition</span>
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./F2.html" class="pagination-link">
<span class="nav-page-text"><span class="chapter-number">4</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-number">2</span>&nbsp; <span class="chapter-title">Interpreting Images</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>