mirror of
https://github.com/bellingcat/RS4OSINT.git
synced 2026-06-07 19:18:36 +03:00
fixed image paths
This commit is contained in:
@@ -11,7 +11,7 @@ Before learning how to load, process, and analyze satellite imagery in Google Ea
|
|||||||
[Remote sensing](https://www.sciencedirect.com/topics/medicine-and-dentistry/remote-sensing) is the science of obtaining information about an object or phenomenon without making physical contact with the object. Remote sensing can be done with various types of electromagnetic radiation such as visible, infrared or microwave. The electromagnetic radiation is either emitted or reflected from the object being sensed. The reflected radiation is then collected by a sensor and processed to obtain information about the object.
|
[Remote sensing](https://www.sciencedirect.com/topics/medicine-and-dentistry/remote-sensing) is the science of obtaining information about an object or phenomenon without making physical contact with the object. Remote sensing can be done with various types of electromagnetic radiation such as visible, infrared or microwave. The electromagnetic radiation is either emitted or reflected from the object being sensed. The reflected radiation is then collected by a sensor and processed to obtain information about the object.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -32,9 +32,9 @@ Spatial resolution governs how "sharp" an image looks. The Google Maps satellite
|
|||||||
Most of the optical imagery that is freely available has relatively low spatial resolution (it looks more grainy than, for example, the Google satellite basemap),
|
Most of the optical imagery that is freely available has relatively low spatial resolution (it looks more grainy than, for example, the Google satellite basemap),
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Spectral Resolution
|
### Spectral Resolution
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ This section highlights ten categories of geospatial data available natively in
|
|||||||
|
|
||||||
|
|
||||||
## Optical Imagery
|
## Optical Imagery
|
||||||
 tutorial.](../images/obj_det3.jpg)
|
 tutorial.](images/obj_det3.jpg)
|
||||||
|
|
||||||
|
|
||||||
Optical satellite imagery is the bread and butter of many open source investigations. It would be tough to list off all of the possible use cases, so here's a handy flowchart:
|
Optical satellite imagery is the bread and butter of many open source investigations. It would be tough to list off all of the possible use cases, so here's a handy flowchart:
|
||||||
@@ -83,7 +83,7 @@ There are several different types of optical satellite imagery available in the
|
|||||||
|
|
||||||
|
|
||||||
## Radar Imagery
|
## Radar Imagery
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses radio waves to detect objects on the ground. SAR imagery is useful for detecting objects that are small, or that are obscured by clouds or other weather phenomena. SAR imagery is also useful for detecting objects that are moving, such as ships or cars.
|
Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses radio waves to detect objects on the ground. SAR imagery is useful for detecting objects that are small, or that are obscured by clouds or other weather phenomena. SAR imagery is also useful for detecting objects that are moving, such as ships or cars.
|
||||||
@@ -109,7 +109,7 @@ Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses rad
|
|||||||
|
|
||||||
|
|
||||||
## Nighttime Lights
|
## Nighttime Lights
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Satellite images of the Earth at night are a useful proxy for human activity. The brightness of a given area at night is a function of the number of people living there and the nature of their activities. The effects of conflict, natural disasters, and economic development can all be inferred from changes in nighttime lights.
|
Satellite images of the Earth at night are a useful proxy for human activity. The brightness of a given area at night is a function of the number of people living there and the nature of their activities. The effects of conflict, natural disasters, and economic development can all be inferred from changes in nighttime lights.
|
||||||
@@ -144,7 +144,7 @@ The timelapse above reveals a number of interesting things: The capture of Mosul
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
{width=100%}
|
{width=100%}
|
||||||
|
|
||||||
|
|
||||||
Climate and atmospheric data can be used to track the effects of conflict on the environment. The European Space Agency's Sentinel-5p satellites measure the concentration of a number of atmospheric gasses, including nitrogen dioxide, methane and ozone. Measurements are available on a daily basis at a fairly high resolution (1km), allowing for the detection of localized sources of pollution such as oil refineries or power plants. For example, see this [Bellingcat article](https://www.bellingcat.com/resources/2021/04/15/what-oil-satellite-technology-and-iraq-can-tell-us-about-pollution/) in which Wim Zwijnenburg and I trace pollution to specific facilities operated by multinational oil companies in Iraq.
|
Climate and atmospheric data can be used to track the effects of conflict on the environment. The European Space Agency's Sentinel-5p satellites measure the concentration of a number of atmospheric gasses, including nitrogen dioxide, methane and ozone. Measurements are available on a daily basis at a fairly high resolution (1km), allowing for the detection of localized sources of pollution such as oil refineries or power plants. For example, see this [Bellingcat article](https://www.bellingcat.com/resources/2021/04/15/what-oil-satellite-technology-and-iraq-can-tell-us-about-pollution/) in which Wim Zwijnenburg and I trace pollution to specific facilities operated by multinational oil companies in Iraq.
|
||||||
@@ -175,7 +175,7 @@ The Copernicus Atmosphere Monitoring Service (CAMS) provides similar data at a l
|
|||||||
|
|
||||||
|
|
||||||
## Mineral Deposits
|
## Mineral Deposits
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Mining activities often play an important role in conflict. According to an influential [study](https://www.aeaweb.org/articles?id=10.1257/aer.20150774), "the historical rise in mineral prices might explain up to one-fourth of the average level of violence across African countries" between 1997 and 2010. Data on the location of mineral deposits can be used to identify areas where mining activities are likely to be taking place, and several such datasets are available in Google Earth Engine.
|
Mining activities often play an important role in conflict. According to an influential [study](https://www.aeaweb.org/articles?id=10.1257/aer.20150774), "the historical rise in mineral prices might explain up to one-fourth of the average level of violence across African countries" between 1997 and 2010. Data on the location of mineral deposits can be used to identify areas where mining activities are likely to be taking place, and several such datasets are available in Google Earth Engine.
|
||||||
@@ -204,7 +204,7 @@ Mining activities often play an important role in conflict. According to an infl
|
|||||||
|
|
||||||
|
|
||||||
## Fires
|
## Fires
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Earth-observing satellites can detect "thermal anomalies" (fires) from space. NASA's Fire Information for Resource Management System (FIRMS) provides daily data on active fires in near real time, going back to the year 2000. Carlos Gonzales wrote a comprehensive [Bellingcat article](https://www.bellingcat.com/resources/2022/10/04/scorched-earth-using-nasa-fire-data-to-monitor-war-zones/) on the use of FIRMS to monitor war zones from Ukraine to Ethiopia. The map above shows that FIRMS detected fires over Eastern Ukraine trace the frontline of the war.
|
Earth-observing satellites can detect "thermal anomalies" (fires) from space. NASA's Fire Information for Resource Management System (FIRMS) provides daily data on active fires in near real time, going back to the year 2000. Carlos Gonzales wrote a comprehensive [Bellingcat article](https://www.bellingcat.com/resources/2022/10/04/scorched-earth-using-nasa-fire-data-to-monitor-war-zones/) on the use of FIRMS to monitor war zones from Ukraine to Ethiopia. The map above shows that FIRMS detected fires over Eastern Ukraine trace the frontline of the war.
|
||||||
@@ -234,7 +234,7 @@ FIRMS data are derived from the MODIS satellite, but only show the central locat
|
|||||||
|
|
||||||
|
|
||||||
## Population Density Estimates
|
## Population Density Estimates
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Sometimes, we may want to get an estimate of the population in a specific area to ballpark how many people might be affected by a natural disaster, a counteroffensive or a missile strike. You can't really Google "what is the population in this rectangle I've drawn in Northeastern Syria?" and get a good answer. Luckily, there are several spatial population datasets hosted in GEE that let you do just that. Some, such as WorldPop, provide estimated breakdowns by age and sex as well. However, it is extremely important to bear in mind that these are **estimates**, and will **not** take into account things like conflict-induced displacement. For example, Oak Ridge National Laboratory's LandScan program has released high-resolution population data for Ukraine, but this pertains to the pre-war population distribution. The war has radically changed this distribution, so these estimates no longer reflect where people *are*. Still, this dataset could be used to roughly estimate displacement or the number of people who will need new housing.
|
Sometimes, we may want to get an estimate of the population in a specific area to ballpark how many people might be affected by a natural disaster, a counteroffensive or a missile strike. You can't really Google "what is the population in this rectangle I've drawn in Northeastern Syria?" and get a good answer. Luckily, there are several spatial population datasets hosted in GEE that let you do just that. Some, such as WorldPop, provide estimated breakdowns by age and sex as well. However, it is extremely important to bear in mind that these are **estimates**, and will **not** take into account things like conflict-induced displacement. For example, Oak Ridge National Laboratory's LandScan program has released high-resolution population data for Ukraine, but this pertains to the pre-war population distribution. The war has radically changed this distribution, so these estimates no longer reflect where people *are*. Still, this dataset could be used to roughly estimate displacement or the number of people who will need new housing.
|
||||||
@@ -261,7 +261,7 @@ Sometimes, we may want to get an estimate of the population in a specific area t
|
|||||||
|
|
||||||
|
|
||||||
## Building Footprints
|
## Building Footprints
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
A building footprint dataset contains the two dimensional outlines of buildings in a given area. Currently, GEE hosts one building footprint dataset which covers all of Africa. In 2022, Microsoft released a free [global building footprint dataset](https://www.microsoft.com/en-us/maps/building-footprints), though to use it in Earth Engine you'll have to download it from their [GitHub page](https://github.com/Microsoft/USBuildingFootprints) and upload it manually to GEE. The same goes for OpenStreetMap (OSM), a public database of building footprints, roads, and other features that also contains useful annotations for many buildings indicating their use. [Benjamin Strick](https://www.youtube.com/watch?v=bJkV3l5Haq0) has a great youtube video on conducting investigations using OSM data.
|
A building footprint dataset contains the two dimensional outlines of buildings in a given area. Currently, GEE hosts one building footprint dataset which covers all of Africa. In 2022, Microsoft released a free [global building footprint dataset](https://www.microsoft.com/en-us/maps/building-footprints), though to use it in Earth Engine you'll have to download it from their [GitHub page](https://github.com/Microsoft/USBuildingFootprints) and upload it manually to GEE. The same goes for OpenStreetMap (OSM), a public database of building footprints, roads, and other features that also contains useful annotations for many buildings indicating their use. [Benjamin Strick](https://www.youtube.com/watch?v=bJkV3l5Haq0) has a great youtube video on conducting investigations using OSM data.
|
||||||
@@ -284,7 +284,7 @@ A building footprint dataset contains the two dimensional outlines of buildings
|
|||||||
|
|
||||||
|
|
||||||
## Administrative Boundaries
|
## Administrative Boundaries
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Spatial analysis often has to aggregate information over a defined area; we may want to assess the total burned area by province in Ukraine, or count the number of Saudi airstrikes by district in Yemen. For that, we need data on these administrative boundaries. GEE hosts several such datasets at the country, province, and district (or equivalent) level.
|
Spatial analysis often has to aggregate information over a defined area; we may want to assess the total burned area by province in Ukraine, or count the number of Saudi airstrikes by district in Yemen. For that, we need data on these administrative boundaries. GEE hosts several such datasets at the country, province, and district (or equivalent) level.
|
||||||
@@ -308,7 +308,7 @@ Spatial analysis often has to aggregate information over a defined area; we may
|
|||||||
|
|
||||||
|
|
||||||
## Global Power Plant Database
|
## Global Power Plant Database
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The Global Power Plant Database is a comprehensive, open source database of power plants around the world. It centralizes power plant data to make it easier to navigate, compare and draw insights. Each power plant is geolocated and entries contain information on plant capacity, generation, ownership, and fuel type. As of June 2018, the database includes around 28,500 power plants from 164 countries. The database is curated by the [World Resources Institute (WRI)](https://datasets.wri.org/dataset/globalpowerplantdatabase).
|
The Global Power Plant Database is a comprehensive, open source database of power plants around the world. It centralizes power plant data to make it easier to navigate, compare and draw insights. Each power plant is geolocated and entries contain information on plant capacity, generation, ownership, and fuel type. As of June 2018, the database includes around 28,500 power plants from 164 countries. The database is curated by the [World Resources Institute (WRI)](https://datasets.wri.org/dataset/globalpowerplantdatabase).
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ If you have not already done so, be sure to add the book’s code repository to
|
|||||||
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 Google’s 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.
|
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 Google’s 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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ print('Hello World');
|
|||||||
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.).
|
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.).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -83,31 +83,31 @@ The line of code above uses the JavaScript print function to print the text “H
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ print(cities);
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ print(cityData);
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Functions {.unnumbered}
|
#### Functions {.unnumbered}
|
||||||
@@ -191,7 +191,7 @@ print(greet('Readers'));
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Comments {.unnumbbered}
|
#### Comments {.unnumbbered}
|
||||||
@@ -219,7 +219,7 @@ Code Checkpoint F10a. The book’s repository contains a script that shows what
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Let’s learn to use the API. Suppose you want to add two numbers, represented by the variables a and b, as below. Make a new script and enter the following:
|
Let’s learn to use the API. Suppose you want to add two numbers, represented by the variables a and b, as below. Make a new script and enter the following:
|
||||||
@@ -233,7 +233,7 @@ In Sect. 1, you learned how to store numbers in variables, but not how to do any
|
|||||||
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. That’s what you use to add a and b.
|
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. That’s what you use to add a and b.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
To add a and b, we first create an ee.Number object from variable a with ee.Number(a). And then we can use the add(b) call to add the value of b to it. The following code shows the syntax and prints the result which, of course, is the value 3.
|
To add a and b, we first create an ee.Number object from variable a with ee.Number(a). And then we can use the add(b) call to add the value of b to it. The following code shows the syntax and prints the result which, of course, is the value 3.
|
||||||
@@ -249,7 +249,7 @@ By now you may have realized that when learning to program in Earth Engine, you
|
|||||||
Here’s another example to drive this point home. Let’s 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.
|
Here’s another example to drive this point home. Let’s 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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The function ee.List.sequence is able to generate a sequence of numbers from a given start value to the end value. It also has an optional parameter step to indicate the increment between each number. We can create a ee.List of numbers representing years from 1980 to 2020, counting by 5, by calling this predefined function with the following values: start = 1980, end = 2020, and step = 5.
|
The function ee.List.sequence is able to generate a sequence of numbers from a given start value to the end value. It also has an optional parameter step to indicate the increment between each number. We can create a ee.List of numbers representing years from 1980 to 2020, counting by 5, by calling this predefined function with the following values: start = 1980, end = 2020, and step = 5.
|
||||||
@@ -260,7 +260,7 @@ print(yearList);
|
|||||||
The output printed in the Console will show that the variable yearList indeed contains the list of years with the correct interval.
|
The output printed in the Console will show that the variable yearList indeed contains the list of years with the correct interval.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
You just accomplished a moderately complex programming task with the help of Earth Engine API.
|
You just accomplished a moderately complex programming task with the help of Earth Engine API.
|
||||||
@@ -344,7 +344,7 @@ print(first_image);
|
|||||||
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 let’s 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).
|
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 let’s 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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
@@ -389,7 +389,7 @@ Can you recognize any features in the image? By comparing it to the standard Goo
|
|||||||
Let’s 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:
|
Let’s 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:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -430,7 +430,7 @@ Map.addLayer(
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Do you see how these new parameters influence the map layer displays (Fig. F1.1.3)? For Layer 2, we set the shown parameter as 0. For Layer 3, we set the opacity parameter as 0. As a result, neither layer is visible to us when we first run the code. We can make each layer visible with controls in the Layers manager checklist on the map (at top right). Expand this list and you should see the names that we gave each layer when we added them to the map. Each name sits between a checkbox and an opacity slider. To make Layer 2 visible, click the checkbox (Fig. F1.1.3, area A). To make Layer 3 visible, move the opacity slider to the right (Fig. F1.1.3, area B).
|
Do you see how these new parameters influence the map layer displays (Fig. F1.1.3)? For Layer 2, we set the shown parameter as 0. For Layer 3, we set the opacity parameter as 0. As a result, neither layer is visible to us when we first run the code. We can make each layer visible with controls in the Layers manager checklist on the map (at top right). Expand this list and you should see the names that we gave each layer when we added them to the map. Each name sits between a checkbox and an opacity slider. To make Layer 2 visible, click the checkbox (Fig. F1.1.3, area A). To make Layer 3 visible, move the opacity slider to the right (Fig. F1.1.3, area B).
|
||||||
@@ -463,7 +463,7 @@ Map.addLayer(
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### False-Color Composites
|
### False-Color Composites
|
||||||
@@ -481,7 +481,7 @@ Map.addLayer(
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -489,7 +489,7 @@ In this false-color composite (Fig. F1.1.5), the display colors no longer pair n
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
In the bottom left corner of the image (Fig. F1.1.5, area C), rivers and lakes appear very dark, which means that the pixel value in all three bands is low. However, sediment plumes fanning from the river into the sea appear with blue and cyan tints (Fig. F1.1.5, area D). If they look like primary blue, then the pixel value for the second band (B3) is likely higher than the first (B4) and third (B2) bands. If they appear more like cyan, an additive color, it means that the pixel values of the second and third bands are both greater than the first.
|
In the bottom left corner of the image (Fig. F1.1.5, area C), rivers and lakes appear very dark, which means that the pixel value in all three bands is low. However, sediment plumes fanning from the river into the sea appear with blue and cyan tints (Fig. F1.1.5, area D). If they look like primary blue, then the pixel value for the second band (B3) is likely higher than the first (B4) and third (B2) bands. If they appear more like cyan, an additive color, it means that the pixel values of the second and third bands are both greater than the first.
|
||||||
@@ -503,16 +503,16 @@ Map.addLayer(
|
|||||||
min: 8000,
|
min: 8000,
|
||||||
max: 17000}, 'Short wave false color');
|
max: 17000}, 'Short wave false color');
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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?
|
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?
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
::: {.callout-note}
|
::: {.callout-note}
|
||||||
@@ -547,7 +547,7 @@ The global nighttime lights image represents the average brightness of nighttime
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -585,7 +585,7 @@ Next, the code uses the addBands method to create a new, three-band image that w
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can now read the colors displayed on the layer to interpret different kinds of changes in nighttime lights across the planet over two decades. Pixels that appear white have high brightness in all three years. You can use the Inspector panel to confirm this. Click on the Inspector panel to change the cursor to a crosshair and then click on a pixel that appears white. Look under the Pixel category of the Inspector panel for the “Change composite” layer. The pixel value for each band should be high (at or near 63).
|
We can now read the colors displayed on the layer to interpret different kinds of changes in nighttime lights across the planet over two decades. Pixels that appear white have high brightness in all three years. You can use the Inspector panel to confirm this. Click on the Inspector panel to change the cursor to a crosshair and then click on a pixel that appears white. Look under the Pixel category of the Inspector panel for the “Change composite” layer. The pixel value for each band should be high (at or near 63).
|
||||||
@@ -600,13 +600,13 @@ When you zoom out from Shanghai, you will likely notice that each map layer redr
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
As you explore this image, remember to check your interpretations with the Inspector panel by clicking on a pixel and reading the pixel value for each band. Refer back to the additive color figure to remember how the color system works. If you practice this, you should be able to read any RGB composite by knowing how colors relate to the relative pixel value of each band. This will empower you to employ false-color composites as a flexible and powerful method to explore and interpret geographic patterns and changes on Earth’s surface.
|
As you explore this image, remember to check your interpretations with the Inspector panel by clicking on a pixel and reading the pixel value for each band. Refer back to the additive color figure to remember how the color system works. If you practice this, you should be able to read any RGB composite by knowing how colors relate to the relative pixel value of each band. This will empower you to employ false-color composites as a flexible and powerful method to explore and interpret geographic patterns and changes on Earth’s surface.
|
||||||
@@ -710,7 +710,7 @@ Map.addLayer(landsat8,
|
|||||||
First, let’s examine the map output (Fig. F1.2.1).
|
First, let’s examine the map output (Fig. F1.2.1).
|
||||||
|
|
||||||
|
|
||||||

|

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

|

|
||||||
|
|
||||||
|
|
||||||
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 don’t want to see a million image names printed to the Console!
|
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 don’t want to see a million image names printed to the Console!
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
::: {.callout-note}
|
::: {.callout-note}
|
||||||
@@ -766,7 +766,7 @@ print('The size of the Winter Landsat 8 image collection is:',
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now look at the size of the winter Landsat 8 collection. The number is significantly lower than the number of images in the entire collection. This is the result of filtering the dates to three months in the winter of 2020–2021.
|
Now look at the size of the winter Landsat 8 collection. The number is significantly lower than the number of images in the entire collection. This is the result of filtering the dates to three months in the winter of 2020–2021.
|
||||||
@@ -798,7 +798,7 @@ print('The size of the Minneapolis Winter Landsat 8 image collection is: ',
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
@@ -828,7 +828,7 @@ Map.addLayer(
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
::: {.callout-note}
|
::: {.callout-note}
|
||||||
@@ -870,7 +870,7 @@ var landsat8SRimage = landsat8SR.filterDate('2014-03-18', '2014-03-19')
|
|||||||
|
|
||||||
print('Landsat 8 Surface Reflectance image', landsat8SRimage);
|
print('Landsat 8 Surface Reflectance image', landsat8SRimage);
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Copy and paste the code below to add this image to the map with adjusted R,G, and B bands in the “bands” parameter for true-color display (see previous chapter).
|
Copy and paste the code below to add this image to the map with adjusted R,G, and B bands in the “bands” parameter for true-color display (see previous chapter).
|
||||||
@@ -887,7 +887,7 @@ Map.addLayer(landsat8SRimage,
|
|||||||
max: 13000},
|
max: 13000},
|
||||||
'Landsat 8 SR');
|
'Landsat 8 SR');
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Compare this image (Fig. F1.2.8) with the raw Landsat 8 images from the previous section (Fig. F1.2.6). Zoom in and out and pan the screen as needed. What do you notice? Save your script but don’t start a new one—we will keep adding code to this script.
|
Compare this image (Fig. F1.2.8) with the raw Landsat 8 images from the previous section (Fig. F1.2.6). Zoom in and out and pan the screen as needed. What do you notice? Save your script but don’t start a new one—we will keep adding code to this script.
|
||||||
@@ -920,7 +920,7 @@ Map.addLayer(modisMonthlyRecent, {}, 'MODIS Monthly Burn');
|
|||||||
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?
|
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?
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
::: {.callout-note}
|
::: {.callout-note}
|
||||||
@@ -970,7 +970,7 @@ Map.addLayer(methane2018, methaneVis, 'Methane');
|
|||||||
Notice the different levels of methane over the African continent (Fig. F1.2.12).
|
Notice the different levels of methane over the African continent (Fig. F1.2.12).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Global Forest Change
|
### Global Forest Change
|
||||||
@@ -999,7 +999,7 @@ Map.addLayer(globalForest, treeCoverViz, 'Hansen 2000 Tree Cover');
|
|||||||
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,” don’t worry. Sometimes Earth Engine will show these transient errors, but they won’t affect the script in any way.
|
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,” don’t worry. Sometimes Earth Engine will show these transient errors, but they won’t affect the script in any way.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Copy and paste the code below to visualize the tree cover loss over the past 20 years.
|
Copy and paste the code below to visualize the tree cover loss over the past 20 years.
|
||||||
@@ -1018,7 +1018,7 @@ Map.addLayer(globalForest, treeLossYearViz, '2000-2020 Year of Loss');
|
|||||||
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)?
|
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)?
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
::: {.callout-note}
|
::: {.callout-note}
|
||||||
@@ -1048,7 +1048,7 @@ Map.addLayer(nasaDEM, {
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Fig. F1.2.18. NASADEM elevation
|
Fig. F1.2.18. NASADEM elevation
|
||||||
@@ -1128,13 +1128,13 @@ Images and image collections form the basis of many remote sensing analyses in E
|
|||||||
Earth Engine’s search bar can be used to find imagery and to locate important information about datasets in Earth Engine. Let’s 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.
|
Earth Engine’s search bar can be used to find imagery and to locate important information about datasets in Earth Engine. Let’s 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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now, click on USGS Landsat 7 Collection 2 Tier 1 Raw Scenes. A new inset window will appear (Fig. F1.3.2).
|
Now, click on USGS Landsat 7 Collection 2 Tier 1 Raw Scenes. A new inset window will appear (Fig. F1.3.2).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The inset window has information about the dataset, including a description, bands that are available, image properties, and terms of use for the data across the top. Click on each of these tabs and read the information provided. While you may not understand all of the information right now, it will set you up for success in future chapters.
|
The inset window has information about the dataset, including a description, bands that are available, image properties, and terms of use for the data across the top. Click on each of these tabs and read the information provided. While you may not understand all of the information right now, it will set you up for success in future chapters.
|
||||||
@@ -1146,19 +1146,19 @@ On the left-hand side of this window, you will see a range of dates when the dat
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now that we know how to view this information, let’s dive into some important remote sensing terminology.
|
Now that we know how to view this information, let’s dive into some important remote sensing terminology.
|
||||||
@@ -1192,7 +1192,7 @@ Map.addLayer(tmImage, {
|
|||||||
bands: ['B4', 'B3', 'B2'], min: 0,
|
bands: ['B4', 'B3', 'B2'], min: 0,
|
||||||
max: 100}, 'TM');
|
max: 100}, 'TM');
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Sentinel-2 MultiSpectral Instrument
|
#### Sentinel-2 MultiSpectral Instrument
|
||||||
@@ -1222,7 +1222,7 @@ Map.addLayer(msiImage, {
|
|||||||
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 Earth’s surface, a much smaller area than the TM imagery (900 m2).
|
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 Earth’s surface, a much smaller area than the TM imagery (900 m2).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### National Agriculture Imagery Program (NAIP)
|
#### National Agriculture Imagery Program (NAIP)
|
||||||
@@ -1249,7 +1249,7 @@ Map.addLayer(naipImage, {
|
|||||||
The NAIP imagery is even more spatially detailed than the Sentinel-2 MSI imagery. However, we can see that our one NAIP image doesn’t 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.
|
The NAIP imagery is even more spatially detailed than the Sentinel-2 MSI imagery. However, we can see that our one NAIP image doesn’t 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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1293,7 +1293,7 @@ var tmChart = ui.Chart.image.series({
|
|||||||
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).
|
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).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
However, viewing this list doesn’t make it easy to see the temporal resolution of the dataset. We can use Earth Engine’s plotting functionality to visualize the temporal resolution of different datasets. For each of the different temporal resolutions, we will create a per-pixel chart of the NIR band that we mapped previously. To do this, we will use the ui.Chart.image.series function.
|
However, viewing this list doesn’t make it easy to see the temporal resolution of the dataset. We can use Earth Engine’s plotting functionality to visualize the temporal resolution of different datasets. For each of the different temporal resolutions, we will create a per-pixel chart of the NIR band that we mapped previously. To do this, we will use the ui.Chart.image.series function.
|
||||||
@@ -1330,7 +1330,7 @@ print('TM Chart', tmChart);
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Sentinel-2
|
#### Sentinel-2
|
||||||
@@ -1350,7 +1350,7 @@ msiChart.setOptions(chartStyle);
|
|||||||
// Print the chart.
|
// Print the chart.
|
||||||
print('MSI Chart', msiChart);
|
print('MSI Chart', msiChart);
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Compare this Sentinel-2 graph (Fig. F1.3.16) with the Landsat graph you just produced (Fig. F1.3.15). Both cover a period of six months, yet there are many more points through time for the Sentinel-2 satellite, reflecting the greater temporal resolution.
|
Compare this Sentinel-2 graph (Fig. F1.3.16) with the Landsat graph you just produced (Fig. F1.3.15). Both cover a period of six months, yet there are many more points through time for the Sentinel-2 satellite, reflecting the greater temporal resolution.
|
||||||
@@ -1422,7 +1422,7 @@ print(modisReflectanceChart);
|
|||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### EO-1
|
#### EO-1
|
||||||
@@ -1471,13 +1471,13 @@ print(eo1Chart);
|
|||||||
The resulting chart is seen in Fig. F1.3.18. There are so many bands that their names only appear as “...”!
|
The resulting chart is seen in Fig. F1.3.18. There are so many bands that their names only appear as “...”!
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
If we click on the expand icon in the top right corner of the chart, it’s a little easier to see the band identifiers, as shown in Fig. F1.3.19.
|
If we click on the expand icon in the top right corner of the chart, it’s a little easier to see the band identifiers, as shown in Fig. F1.3.19.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Compare this hyperspectral instrument chart with the multispectral chart we plotted above for MODIS.
|
Compare this hyperspectral instrument chart with the multispectral chart we plotted above for MODIS.
|
||||||
@@ -1544,7 +1544,7 @@ print('MSI Image Metadata', msiImage);
|
|||||||
Examine the object you’ve created in the Console (Fig. F1.3.20). Expand the image name, then the properties object.
|
Examine the object you’ve created in the Console (Fig. F1.3.20). Expand the image name, then the properties object.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Fig. F1.3.20 Checking the “CLOUDY_PIXEL_PERCENTAGE” property in the metadata for Sentinel-2
|
Fig. F1.3.20 Checking the “CLOUDY_PIXEL_PERCENTAGE” property in the metadata for Sentinel-2
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Once images have been identified in Earth Engine, they can be viewed in a wide a
|
|||||||
Spectral indices are based on the fact that different objects and land covers on the Earth’s surface reflect different amounts of light from the Sun at different wavelengths. In the visible part of the spectrum, for example, a healthy green plant reflects a large amount of green light while absorbing blue and red light — which is why it appears green to our eyes. Light also arrives from the Sun at wavelengths outside what the human eye can see, and there are large differences in reflectances between living and nonliving land covers, and between different types of vegetation, both in the visible and outside the visible wavelengths. We visualized this earlier, in Chaps. F1.1 and F1.3 when we mapped color-infrared images (Fig. F2.0.1).
|
Spectral indices are based on the fact that different objects and land covers on the Earth’s surface reflect different amounts of light from the Sun at different wavelengths. In the visible part of the spectrum, for example, a healthy green plant reflects a large amount of green light while absorbing blue and red light — which is why it appears green to our eyes. Light also arrives from the Sun at wavelengths outside what the human eye can see, and there are large differences in reflectances between living and nonliving land covers, and between different types of vegetation, both in the visible and outside the visible wavelengths. We visualized this earlier, in Chaps. F1.1 and F1.3 when we mapped color-infrared images (Fig. F2.0.1).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ Spectral indices are based on the fact that different objects and land covers on
|
|||||||
If we graph the amount of light (reflectance) at different wavelengths that an object or land cover reflects, we can visualize this more easily (Fig. F2.0.2). For example, look at the reflectance curves for soil and water in the graph below. Soil and water both have relatively low reflectance at wavelengths around 300 nm (ultraviolet and violet light). Conversely, at wavelengths above 700 nm (red and infrared light) soil has relatively high reflectance, while water has very low reflectance. Vegetation, meanwhile, generally reflects large amounts of near infrared light, relative to other land covers.
|
If we graph the amount of light (reflectance) at different wavelengths that an object or land cover reflects, we can visualize this more easily (Fig. F2.0.2). For example, look at the reflectance curves for soil and water in the graph below. Soil and water both have relatively low reflectance at wavelengths around 300 nm (ultraviolet and violet light). Conversely, at wavelengths above 700 nm (red and infrared light) soil has relatively high reflectance, while water has very low reflectance. Vegetation, meanwhile, generally reflects large amounts of near infrared light, relative to other land covers.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ The red and near-infrared bands provide a lot of information about vegetation du
|
|||||||
Soon after the launch of Landsat 1 in 1972, analysts worked to devise a robust single value that would convey the health of vegetation along a scale of −1 to 1. This yielded the NDVI, using the formula:
|
Soon after the launch of Landsat 1 in 1972, analysts worked to devise a robust single value that would convey the health of vegetation along a scale of −1 to 1. This yielded the NDVI, using the formula:
|
||||||
|
|
||||||
|
|
||||||
 (F2.0.1)
|
 (F2.0.1)
|
||||||
|
|
||||||
|
|
||||||
where NIR and red refer to the brightness of each of those two bands. As seen in Chaps. F1.1 and F1.2, this brightness might be conveyed in units of reflectance, radiance, or digital number (DN); the NDVI is intended to give nearly equivalent values across platforms that use these wavelengths. The general form of this equation is called a “normalized difference”—the numerator is the “difference” and the denominator “normalizes” the value. Outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.
|
where NIR and red refer to the brightness of each of those two bands. As seen in Chaps. F1.1 and F1.2, this brightness might be conveyed in units of reflectance, radiance, or digital number (DN); the NDVI is intended to give nearly equivalent values across platforms that use these wavelengths. The general form of this equation is called a “normalized difference”—the numerator is the “difference” and the denominator “normalizes” the value. Outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.
|
||||||
@@ -129,7 +129,7 @@ Map.addLayer(sfoImage, {
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ Map.addLayer(ndvi, {
|
|||||||
Examine the resulting index, using the Inspector to pick out pixel values in areas of vegetation and non-vegetation if desired.
|
Examine the resulting index, using the Inspector to pick out pixel values in areas of vegetation and non-vegetation if desired.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ As mentioned, the normalized difference approach is used for many different indi
|
|||||||
The Normalized Difference Water Index (NDWI) was developed by Gao (1996) as an index of vegetation water content. The index is sensitive to changes in the liquid content of vegetation canopies. This means that the index can be used, for example, to detect vegetation experiencing drought conditions or differentiate crop irrigation levels. In dry areas, crops that are irrigated can be differentiated from natural vegetation. It is also sometimes called the Normalized Difference Moisture Index (NDMI). NDWI is formulated as follows:
|
The Normalized Difference Water Index (NDWI) was developed by Gao (1996) as an index of vegetation water content. The index is sensitive to changes in the liquid content of vegetation canopies. This means that the index can be used, for example, to detect vegetation experiencing drought conditions or differentiate crop irrigation levels. In dry areas, crops that are irrigated can be differentiated from natural vegetation. It is also sometimes called the Normalized Difference Moisture Index (NDMI). NDWI is formulated as follows:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
where NIR is near-infrared, centered near 860 nm (0.86 μm), and SWIR is short-wave infrared, centered near 1,240 nm (1.24 μm).
|
where NIR is near-infrared, centered near 860 nm (0.86 μm), and SWIR is short-wave infrared, centered near 1,240 nm (1.24 μm).
|
||||||
@@ -223,7 +223,7 @@ Map.addLayer(ndwi, {
|
|||||||
Examine the areas of the map that NDVI identified as having a lot of vegetation. Notice which are more blue. This is vegetation that has higher water content.
|
Examine the areas of the map that NDVI identified as having a lot of vegetation. Notice which are more blue. This is vegetation that has higher water content.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ Map.addLayer(seaNDVI,
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ Map.addLayer(seaVeg,
|
|||||||
The gt method is from the family of Boolean operators — that is, gt is a function that performs a test in each pixel and returns the value 1 if the test evaluates to true, and 0 otherwise. Here, for every pixel in the image, it tests whether the NDVI value is greater than 0.5. When this condition is met, the layer seaVeg gets the value 1. When the condition is false, it receives the value 0.
|
The gt method is from the family of Boolean operators — that is, gt is a function that performs a test in each pixel and returns the value 1 if the test evaluates to true, and 0 otherwise. Here, for every pixel in the image, it tests whether the NDVI value is greater than 0.5. When this condition is met, the layer seaVeg gets the value 1. When the condition is false, it receives the value 0.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ Map.addLayer(seaWhere,
|
|||||||
There are a few interesting things to note about this code that you may not have seen before. First, we’re not defining a new variable for each where call. As a result, we can perform many where calls without creating a new variable each time and needing to keep track of them. Second, when we created the starting image, we set the value to 1. This means that we could easily set the bottom and top values with one where clause each. Finally, while we did not do it here, we can combine multiple where clauses using and and or. For example, we could identify pixels with an intermediate level of NDVI using seaNDVI.gte(-0.1).and(seaNDVI.lt(0.5)).
|
There are a few interesting things to note about this code that you may not have seen before. First, we’re not defining a new variable for each where call. As a result, we can perform many where calls without creating a new variable each time and needing to keep track of them. Second, when we created the starting image, we set the value to 1. This means that we could easily set the bottom and top values with one where clause each. Finally, while we did not do it here, we can combine multiple where clauses using and and or. For example, we could identify pixels with an intermediate level of NDVI using seaNDVI.gte(-0.1).and(seaNDVI.lt(0.5)).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ Map.addLayer(seaVeg.mask(), {}, 'seaVeg Mask');
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ Map.addLayer(maskedVeg,
|
|||||||
Turn off all of the other layers. You can see how the maskedVeg layer now has masked out all non-forested areas.
|
Turn off all of the other layers. You can see how the maskedVeg layer now has masked out all non-forested areas.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ Map.addLayer(maskedVeg.mask(), {}, 'maskedVeg Mask');
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ Map.addLayer(seaRemap,
|
|||||||
Use the inspector to compare values between our original seaWhere (displayed as Water, Non-Forest, Forest) and the seaRemap, marked as “Remapped Values.” Click on a forested area and you should see that the Remapped Values should be 10, instead of 2 (Fig. F2.0.12).
|
Use the inspector to compare values between our original seaWhere (displayed as Water, Non-Forest, Forest) and the seaRemap, marked as “Remapped Values.” Click on a forested area and you should see that the Remapped Values should be 10, instead of 2 (Fig. F2.0.12).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ Classification is addressed in a broad range of fields, including mathematics, s
|
|||||||
In remote sensing, image classification is an attempt to categorize all pixels in an image into a finite number of labeled land cover and/or land use classes. The resulting classified image is a simplified thematic map derived from the original image (Fig. F2.1.1). Land cover and land use information is essential for many environmental and socioeconomic applications, including natural resource management, urban planning, biodiversity conservation, agricultural monitoring and carbon accounting.
|
In remote sensing, image classification is an attempt to categorize all pixels in an image into a finite number of labeled land cover and/or land use classes. The resulting classified image is a simplified thematic map derived from the original image (Fig. F2.1.1). Land cover and land use information is essential for many environmental and socioeconomic applications, including natural resource management, urban planning, biodiversity conservation, agricultural monitoring and carbon accounting.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -622,7 +622,7 @@ Map.addLayer(landsat, visParams, 'Landsat 8 image');
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ Using the Geometry Tools, we will create points on the Landsat image that repres
|
|||||||
In the Geometry Tools, click on the marker option (Fig. F2.1.3). This will create a point geometry which will show up as an import named “geometry”. Click on the gear icon to configure this import.
|
In the Geometry Tools, click on the marker option (Fig. F2.1.3). This will create a point geometry which will show up as an import named “geometry”. Click on the gear icon to configure this import.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -653,7 +653,7 @@ Hexadecimal values are used throughout the digital world to represent specific c
|
|||||||
Returning to the coloring of the forest points, the hexadecimal value “589400” is a little bit of red, about twice as much green and no blue: the deep green seen in Figure F2.1.4. Enter that value, with or without the “#” in front, and click OK after finishing the configuration.
|
Returning to the coloring of the forest points, the hexadecimal value “589400” is a little bit of red, about twice as much green and no blue: the deep green seen in Figure F2.1.4. Enter that value, with or without the “#” in front, and click OK after finishing the configuration.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -661,7 +661,7 @@ Returning to the coloring of the forest points, the hexadecimal value “589400
|
|||||||
Now, in the Geometry Imports, we will see that the import has been renamed forest. Click on it to activate the drawing mode (Fig. F2.1.5) in order to start collecting forest points.
|
Now, in the Geometry Imports, we will see that the import has been renamed forest. Click on it to activate the drawing mode (Fig. F2.1.5) in order to start collecting forest points.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -669,7 +669,7 @@ Now, in the Geometry Imports, we will see that the import has been renamed fores
|
|||||||
Now, start collecting points over forested areas (Fig. F2.1.6). Zoom in and out as needed. You can use the satellite basemap to assist you, but the basis of your collection should be the Landsat image. Remember that the more points you collect, the more the classifier will learn from the information you provide. For now, let’s set a goal to collect 25 points per class. Click Exit next to Point drawing (Fig. F2.1.5) when finished.
|
Now, start collecting points over forested areas (Fig. F2.1.6). Zoom in and out as needed. You can use the satellite basemap to assist you, but the basis of your collection should be the Landsat image. Remember that the more points you collect, the more the classifier will learn from the information you provide. For now, let’s set a goal to collect 25 points per class. Click Exit next to Point drawing (Fig. F2.1.5) when finished.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ Now, start collecting points over forested areas (Fig. F2.1.6). Zoom in and out
|
|||||||
Repeat the same process for the other classes by creating new layers (Fig. F2.1.7). Don’t forget to import using the FeatureCollection option as mentioned above. For the developed class, collect points over urban areas. For the water class, collect points over the Ligurian Sea, and also look for other bodies of water, like rivers. For the herbaceous class, collect points over agricultural fields. Remember to set the “class” property for each class to its corresponding code (see Table 2.1.1) and click Exit once you finalize collecting points for each class as mentioned above. We will be using the following hexadecimal colors for the other classes: #FF0000 for developed, #1A11FF for water, and #D0741E for herbaceous.
|
Repeat the same process for the other classes by creating new layers (Fig. F2.1.7). Don’t forget to import using the FeatureCollection option as mentioned above. For the developed class, collect points over urban areas. For the water class, collect points over the Ligurian Sea, and also look for other bodies of water, like rivers. For the herbaceous class, collect points over agricultural fields. Remember to set the “class” property for each class to its corresponding code (see Table 2.1.1) and click Exit once you finalize collecting points for each class as mentioned above. We will be using the following hexadecimal colors for the other classes: #FF0000 for developed, #1A11FF for water, and #D0741E for herbaceous.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -685,7 +685,7 @@ Repeat the same process for the other classes by creating new layers (Fig. F2.1.
|
|||||||
You should now have four FeatureCollection imports named forest, developed, water, and herbaceous (Fig. F2.1.8).
|
You should now have four FeatureCollection imports named forest, developed, water, and herbaceous (Fig. F2.1.8).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -733,7 +733,7 @@ var classifierTraining = landsat.select(predictionBands)
|
|||||||
You can check whether the classifierTraining object extracted the properties of interest by printing it and expanding the first feature. You should see the band and class information (Fig. F2.1.9).
|
You can check whether the classifierTraining object extracted the properties of interest by printing it and expanding the first feature. You should see the band and class information (Fig. F2.1.9).
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ You can check whether the classifierTraining object extracted the properties of
|
|||||||
Now we can choose a classifier. The choice of classifier is not always obvious, and there are many options from which to pick — you can quickly expand the ee.Classifier object under Docs to get an idea of how many options we have for image classification. Therefore, we will be testing different classifiers and comparing their results. We will start with a Classification and Regression Tree (CART) classifier, a well-known classification algorithm (Fig. F2.1.10) that has been around for decades.
|
Now we can choose a classifier. The choice of classifier is not always obvious, and there are many options from which to pick — you can quickly expand the ee.Classifier object under Docs to get an idea of how many options we have for image classification. Therefore, we will be testing different classifiers and comparing their results. We will start with a Classification and Regression Tree (CART) classifier, a well-known classification algorithm (Fig. F2.1.10) that has been around for decades.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -796,7 +796,7 @@ Inspect the result: Activate the Landsat composite layer and the satellite basem
|
|||||||
* Add more predictors. We can try adding spectral indices to the input variables; this way, we are feeding the classifier new, unique information about each class. For example, there is a good chance that a vegetation index specialized for detecting vegetation health (e.g., NDVI) would improve the developed versus herbaceous classification.
|
* Add more predictors. We can try adding spectral indices to the input variables; this way, we are feeding the classifier new, unique information about each class. For example, there is a good chance that a vegetation index specialized for detecting vegetation health (e.g., NDVI) would improve the developed versus herbaceous classification.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -804,7 +804,7 @@ Inspect the result: Activate the Landsat composite layer and the satellite basem
|
|||||||
For now, we will try another supervised learning classifier that is widely used: Random Forests (RF). The RF algorithm (Breiman 2001, Pal 2005) builds on the concept of decision trees, but adds strategies to make them more powerful. It is called a “forest” because it operates by constructing a multitude of decision trees. As mentioned previously, a decision tree creates the rules which are used to make decisions. A Random Forest will randomly choose features and make observations, build a forest of decision trees and then use the full set of trees to estimate the class. It is a great choice when you do not have a lot of insight about the training data.
|
For now, we will try another supervised learning classifier that is widely used: Random Forests (RF). The RF algorithm (Breiman 2001, Pal 2005) builds on the concept of decision trees, but adds strategies to make them more powerful. It is called a “forest” because it operates by constructing a multitude of decision trees. As mentioned previously, a decision tree creates the rules which are used to make decisions. A Random Forest will randomly choose features and make observations, build a forest of decision trees and then use the full set of trees to estimate the class. It is a great choice when you do not have a lot of insight about the training data.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -837,7 +837,7 @@ Note that in the ee.Classifier.smileRandomForest documentation (Docs tab), there
|
|||||||
Inspect the result (Fig. F2.1.13). How does this classified image differ from the CART one? Is the classifications better or worse? Zoom in and out and change the transparency of layers as needed. In Chap. F2.2, you will see more systematic ways to assess what is better or worse, based on accuracy metrics.
|
Inspect the result (Fig. F2.1.13). How does this classified image differ from the CART one? Is the classifications better or worse? Zoom in and out and change the transparency of layers as needed. In Chap. F2.2, you will see more systematic ways to assess what is better or worse, based on accuracy metrics.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -880,7 +880,7 @@ var training = landsat.sample({
|
|||||||
Now we can instantiate a clusterer and train it. As with the supervised algorithms, there are many unsupervised algorithms to choose from. We will use the k-means clustering algorithm, which is a commonly used approach in remote sensing. This algorithm identifies groups of pixels near each other in the spectral space (image x bands) by using an iterative regrouping strategy. We define a number of clusters, k, and then the method randomly distributes that number of seed points into the spectral space. A large sample of pixels is then grouped into its closest seed, and the mean spectral value of this group is calculated. That mean value is akin to a center of mass of the points, and is known as the centroid. Each iteration recalculates the class means and reclassifies pixels with respect to the new means. This process is repeated until the centroids remain relatively stable and only a few pixels change from class to class on subsequent iterations.
|
Now we can instantiate a clusterer and train it. As with the supervised algorithms, there are many unsupervised algorithms to choose from. We will use the k-means clustering algorithm, which is a commonly used approach in remote sensing. This algorithm identifies groups of pixels near each other in the spectral space (image x bands) by using an iterative regrouping strategy. We define a number of clusters, k, and then the method randomly distributes that number of seed points into the spectral space. A large sample of pixels is then grouped into its closest seed, and the mean spectral value of this group is calculated. That mean value is akin to a center of mass of the points, and is known as the centroid. Each iteration recalculates the class means and reclassifies pixels with respect to the new means. This process is repeated until the centroids remain relatively stable and only a few pixels change from class to class on subsequent iterations.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -906,7 +906,7 @@ Map.addLayer(Kclassified.randomVisualizer(), {}, 'K-means classified - random
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1135,10 +1135,10 @@ In this case, the classifier correctly identified 307 forest pixels, wrongly cla
|
|||||||
The overall accuracy tells us what proportion of the reference data was classified correctly, and is calculated as the total number of correctly identified pixels divided by the total number of pixels in the sample.
|
The overall accuracy tells us what proportion of the reference data was classified correctly, and is calculated as the total number of correctly identified pixels divided by the total number of pixels in the sample.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
In this case, the overall accuracy is 96.8%, calculated using (.
|
In this case, the overall accuracy is 96.8%, calculated using (.
|
||||||
|
|
||||||
|
|
||||||
Two other important accuracy metrics are the producer’s accuracy and the user’s accuracy, also referred to as the “recall” and the “precision,” respectively. Importantly, these metrics quantify aspects of per-class accuracy.
|
Two other important accuracy metrics are the producer’s accuracy and the user’s accuracy, also referred to as the “recall” and the “precision,” respectively. Importantly, these metrics quantify aspects of per-class accuracy.
|
||||||
@@ -1147,31 +1147,31 @@ Two other important accuracy metrics are the producer’s accuracy and the user
|
|||||||
The producer’s accuracy is the accuracy of the map from the point of view of the map maker (the “producer”), and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels actually in that class. The producer’s accuracy for a given class tells us the proportion of the pixels in that class that were classified correctly.
|
The producer’s accuracy is the accuracy of the map from the point of view of the map maker (the “producer”), and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels actually in that class. The producer’s accuracy for a given class tells us the proportion of the pixels in that class that were classified correctly.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
In this case, the producer’s accuracy for the forest class is 95.6%, calculated using ). The producer’s accuracy for the non-forest class is 97.3%, calculated from ).
|
In this case, the producer’s accuracy for the forest class is 95.6%, calculated using ). The producer’s accuracy for the non-forest class is 97.3%, calculated from ).
|
||||||
|
|
||||||
|
|
||||||
The user’s accuracy (also called the “consumer’s accuracy”) is the accuracy of the map from the point of view of a map user, and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels claimed to be in that class. The user’s accuracy for a given class tells us the proportion of the pixels identified on the map as being in that class that are actually in that class on the ground.
|
The user’s accuracy (also called the “consumer’s accuracy”) is the accuracy of the map from the point of view of a map user, and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels claimed to be in that class. The user’s accuracy for a given class tells us the proportion of the pixels identified on the map as being in that class that are actually in that class on the ground.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
In this case, the user’s accuracy for the forest class is 94.5%, calculated using ). The user’s accuracy for the non-forest class is 97.9%, calculated from ).
|
In this case, the user’s accuracy for the forest class is 94.5%, calculated using ). The user’s accuracy for the non-forest class is 97.9%, calculated from ).
|
||||||
|
|
||||||
|
|
||||||
Fig. F2.2.1 helps visualize the rows and columns used to calculate each accuracy.
|
Fig. F2.2.1 helps visualize the rows and columns used to calculate each accuracy.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1179,25 +1179,25 @@ Fig. F2.2.1 helps visualize the rows and columns used to calculate each accuracy
|
|||||||
It is very common to talk about two types of error when addressing remote-sensing classification accuracy: omission errors and commission errors. Omission errors refer to the reference pixels that were left out of (omitted from) the correct class in the classified map. In a two-class system, an error of omission in one class will be counted as an error of commission in another class. Omission errors are complementary to the producer’s accuracy.
|
It is very common to talk about two types of error when addressing remote-sensing classification accuracy: omission errors and commission errors. Omission errors refer to the reference pixels that were left out of (omitted from) the correct class in the classified map. In a two-class system, an error of omission in one class will be counted as an error of commission in another class. Omission errors are complementary to the producer’s accuracy.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Commission errors refer to the class pixels that were erroneously classified in the map and are complementary to the user’s accuracy.
|
Commission errors refer to the class pixels that were erroneously classified in the map and are complementary to the user’s accuracy.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Finally, another commonly used accuracy metric is the kappa coefficient, which evaluates how well the classification performed as compared to random. The value of the kappa coefficient can range from −1 to 1: a negative value indicates that the classification is worse than a random assignment of categories would have been; a value of 0 indicates that the classification is no better or worse than random; and a positive value indicates that the classification is better than random.
|
Finally, another commonly used accuracy metric is the kappa coefficient, which evaluates how well the classification performed as compared to random. The value of the kappa coefficient can range from −1 to 1: a negative value indicates that the classification is worse than a random assignment of categories would have been; a value of 0 indicates that the classification is no better or worse than random; and a positive value indicates that the classification is better than random.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The chance agreement is calculated as the sum of the product of row and column totals for each class, and the observed accuracy is the overall accuracy. Therefore, for our example, the kappa coefficient is 0.927.
|
The chance agreement is calculated as the sum of the product of row and column totals for each class, and the observed accuracy is the overall accuracy. Therefore, for our example, the kappa coefficient is 0.927.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now, let’s go back to the script. In Earth Engine, there are API calls for these operations. Note that our confusion matrix will be a 4 x 4 table, since we have four different classes.
|
Now, let’s go back to the script. In Earth Engine, there are API calls for these operations. Note that our confusion matrix will be a 4 x 4 table, since we have four different classes.
|
||||||
@@ -1270,7 +1270,7 @@ print(ui.Chart.array.values({
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ This counterexample would also have other complications—such as the need to tr
|
|||||||
|
|
||||||
The first part of the filter, map, reduce paradigm is “filtering” to get a smaller ImageCollection from a larger one. As in the milk example, filters take a large set of items, limit it by some criterion, and return a smaller set for consideration. Here, filters take an ImageCollection, limit it by some criterion of date, location, or image characteristics, and return a smaller ImageCollection (Fig. F4.0.1).
|
The first part of the filter, map, reduce paradigm is “filtering” to get a smaller ImageCollection from a larger one. As in the milk example, filters take a large set of items, limit it by some criterion, and return a smaller set for consideration. Here, filters take an ImageCollection, limit it by some criterion of date, location, or image characteristics, and return a smaller ImageCollection (Fig. F4.0.1).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
As described first in Chap. F1.2, the Earth Engine API provides a set of filters for the ImageCollection type. The filters can limit an ImageCollection based on spatial, temporal, or attribute characteristics. Filters were used in Parts F1, F2, and F3 without much context or explanation, to isolate an image from an ImageCollection for inspection or manipulation. The information below should give perspective on that work while introducing some new tools for filtering image collections.
|
As described first in Chap. F1.2, the Earth Engine API provides a set of filters for the ImageCollection type. The filters can limit an ImageCollection based on spatial, temporal, or attribute characteristics. Filters were used in Parts F1, F2, and F3 without much context or explanation, to isolate an image from an ImageCollection for inspection or manipulation. The information below should give perspective on that work while introducing some new tools for filtering image collections.
|
||||||
@@ -235,9 +235,9 @@ Map.addLayer(L5EVImedian, {
|
|||||||
palette: ['red', 'white', 'green']
|
palette: ['red', 'white', 'green']
|
||||||
}, 'Median EVI');
|
}, 'Median EVI');
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
There are many more reducers that work with an ImageCollection to produce a wide range of summary statistics. Reducers are not limited to returning only one item from the reduction. The minMax reducer, for example, returns a two-band image for each band it is given, one for the minimum and one for the maximum.
|
There are many more reducers that work with an ImageCollection to produce a wide range of summary statistics. Reducers are not limited to returning only one item from the reduction. The minMax reducer, for example, returns a two-band image for each band it is given, one for the minimum and one for the maximum.
|
||||||
@@ -317,7 +317,7 @@ Map.addLayer(filteredIC, {}, 'TOA image collection');
|
|||||||
```
|
```
|
||||||
The three selected bands (which correspond to SWIR1, NIR, and Red) display a false-color image that accentuates differences between different land covers (e.g., concrete, vegetation) in Lisbon. With the Inspector tab highlighted (Fig. F4.1.1), clicking on a point will bring up the values of bands 6, 5, and 4 from each of the images. If you open the Series option, you’ll see the values through time. For the specified point and for all other points in Lisbon (since they are all enclosed in the same Landsat scene), there are 16 images gathered in 2020. By following one of the graphed lines (in blue, yellow, or red) with your finger, you should be able to count that many distinct values. Moving the mouse along the lines will show the specific values and the image dates.
|
The three selected bands (which correspond to SWIR1, NIR, and Red) display a false-color image that accentuates differences between different land covers (e.g., concrete, vegetation) in Lisbon. With the Inspector tab highlighted (Fig. F4.1.1), clicking on a point will bring up the values of bands 6, 5, and 4 from each of the images. If you open the Series option, you’ll see the values through time. For the specified point and for all other points in Lisbon (since they are all enclosed in the same Landsat scene), there are 16 images gathered in 2020. By following one of the graphed lines (in blue, yellow, or red) with your finger, you should be able to count that many distinct values. Moving the mouse along the lines will show the specific values and the image dates.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can also show this kind of chart automatically by making use of the ui.Chart function of the Earth Engine API. The following code snippet should result in the same chart as we could observe in the Inspector tab, assuming the same pixel is clicked.
|
We can also show this kind of chart automatically by making use of the ui.Chart function of the Earth Engine API. The following code snippet should result in the same chart as we could observe in the Inspector tab, assuming the same pixel is clicked.
|
||||||
@@ -368,7 +368,7 @@ Map.centerObject(lisbonPoint, 5);
|
|||||||
```
|
```
|
||||||
Run the command and zoom out. If the count of images over the entire Earth is viewed, the resulting map should look like Fig. F4.1.2. The created map data may take a few minutes to fully load in.
|
Run the command and zoom out. If the count of images over the entire Earth is viewed, the resulting map should look like Fig. F4.1.2. The created map data may take a few minutes to fully load in.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Note the checkered pattern, somewhat reminiscent of a Mondrian painting. To understand why the image looks this way, it is useful to consider the overlapping image footprints. As Landsat passes over, each image is wide enough to produce substantial “sidelap” with the images from the adjacent paths, which are collected at different dates according to the satellite’s orbit schedule. In the north-south direction, there is also some overlap to ensure that there are no gaps in the data. Because these are served as distinct images and stored distinctly in Earth Engine, you will find that there can be two images from the same day with the same value for points in these overlap areas. Depending on the purposes of a study, you might find a way to ignore the duplicate pixel values during the analysis process.
|
Note the checkered pattern, somewhat reminiscent of a Mondrian painting. To understand why the image looks this way, it is useful to consider the overlapping image footprints. As Landsat passes over, each image is wide enough to produce substantial “sidelap” with the images from the adjacent paths, which are collected at different dates according to the satellite’s orbit schedule. In the north-south direction, there is also some overlap to ensure that there are no gaps in the data. Because these are served as distinct images and stored distinctly in Earth Engine, you will find that there can be two images from the same day with the same value for points in these overlap areas. Depending on the purposes of a study, you might find a way to ignore the duplicate pixel values during the analysis process.
|
||||||
@@ -419,7 +419,7 @@ Map.addLayer(p30, {
|
|||||||
max: 0.35}, '30%');
|
max: 0.35}, '30%');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can see that the resulting composite image (Fig. 4.1.3) has almost no cloudy pixels present for this area. This happens because cloudy pixels usually have higher reflectance values. At the lowest end of the values, other unwanted effects like cloud or hill shadows typically have very low reflectance values. This is why this 30th percentile composite image looks so much cleaner than the mean composite image (meanFilteredIC) calculated earlier. Note that the reducers operate per pixel: adjacent pixels are drawn from different images. This means that one pixel’s value could be taken from an image from one date, and the adjacent pixel’s value drawn from an entirely different period. Although, like the mean and median images, percentile images such as that seen in Fig. F4.1.3 never existed on a single day, composite images allow us to view Earth’s surface without the noise that can make analysis difficult.
|
We can see that the resulting composite image (Fig. 4.1.3) has almost no cloudy pixels present for this area. This happens because cloudy pixels usually have higher reflectance values. At the lowest end of the values, other unwanted effects like cloud or hill shadows typically have very low reflectance values. This is why this 30th percentile composite image looks so much cleaner than the mean composite image (meanFilteredIC) calculated earlier. Note that the reducers operate per pixel: adjacent pixels are drawn from different images. This means that one pixel’s value could be taken from an image from one date, and the adjacent pixel’s value drawn from an entirely different period. Although, like the mean and median images, percentile images such as that seen in Fig. F4.1.3 never existed on a single day, composite images allow us to view Earth’s surface without the noise that can make analysis difficult.
|
||||||
@@ -438,7 +438,7 @@ percentiles.map(function(p) { var image = filteredIC.reduce(ee.Reducer.percent
|
|||||||
```
|
```
|
||||||
Note that the code adds every percentile image as a separate map layer, so you need to go to the Layers control and show/hide different layers to explore differences. Here, we can see that low-percentile composite images depict darker, low-reflectance land features, such as water and cloud or hill shadows, while higher-percentile composite images (>70% in our example) depict clouds and any other atmospheric or land effects corresponding to bright reflectance values.
|
Note that the code adds every percentile image as a separate map layer, so you need to go to the Layers control and show/hide different layers to explore differences. Here, we can see that low-percentile composite images depict darker, low-reflectance land features, such as water and cloud or hill shadows, while higher-percentile composite images (>70% in our example) depict clouds and any other atmospheric or land effects corresponding to bright reflectance values.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Earth Engine provides a very rich API, allowing users to explore image collections to better understand the extent and variability of data in space, time, and across bands, as well as tools to analyze values stored in image collections in a frequency domain. Exploring these values in different forms should be the first step of any study before developing data analysis algorithms.
|
Earth Engine provides a very rich API, allowing users to explore image collections to better understand the extent and variability of data in space, time, and across bands, as well as tools to analyze values stored in image collections in a frequency domain. Exploring these values in different forms should be the first step of any study before developing data analysis algorithms.
|
||||||
@@ -524,7 +524,7 @@ print(yearFiltered, 'Date-filtered CHIRPS images');
|
|||||||
|
|
||||||
The CHIRPS collection contains one image for every pentad. The filtered collection above is filtered to contain one year, which equates to 72 global images. If you expand the printed collection in the Console, you will be able to see the metadata for individual images; note that their date stamps indicate that they are spaced evenly every five days (Fig. F4.2.1).
|
The CHIRPS collection contains one image for every pentad. The filtered collection above is filtered to contain one year, which equates to 72 global images. If you expand the printed collection in the Console, you will be able to see the metadata for individual images; note that their date stamps indicate that they are spaced evenly every five days (Fig. F4.2.1).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Each image’s pixel values store the total precipitation during the pentad. Without aggregation to a period that matches other datasets, these layers are not very useful. For hydrological analysis, we typically need the total precipitation for each month or for a season. Let’s aggregate this collection so that we have 12 images—one image per month, with pixel values that represent the total precipitation for that month.
|
Each image’s pixel values store the total precipitation during the pentad. Without aggregation to a period that matches other datasets, these layers are not very useful. For hydrological analysis, we typically need the total precipitation for each month or for a season. Let’s aggregate this collection so that we have 12 images—one image per month, with pixel values that represent the total precipitation for that month.
|
||||||
@@ -608,7 +608,7 @@ print(monthlyCollection);
|
|||||||
```
|
```
|
||||||
We have now successfully computed an aggregated collection from the source ImageCollection by filtering, mapping, and reducing, as described in Chaps. F4.0 and F4.1. Expand the printed collection in the Console and you can verify that we now have 12 images in the newly created ImageCollection (Fig. F4.2.2).
|
We have now successfully computed an aggregated collection from the source ImageCollection by filtering, mapping, and reducing, as described in Chaps. F4.0 and F4.1. Expand the printed collection in the Console and you can verify that we now have 12 images in the newly created ImageCollection (Fig. F4.2.2).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -660,7 +660,7 @@ print(chart);
|
|||||||
```
|
```
|
||||||
The customized chart (Fig. F4.2.3) shows the typical rainfall pattern in the city of Bengaluru, India. Bengaluru has a temperate climate, with pre-monsoon rains in April and May cooling down the city and a moderate monsoon season lasting from June to September.
|
The customized chart (Fig. F4.2.3) shows the typical rainfall pattern in the city of Bengaluru, India. Bengaluru has a temperate climate, with pre-monsoon rains in April and May cooling down the city and a moderate monsoon season lasting from June to September.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -795,7 +795,7 @@ var visParams = {
|
|||||||
Map.addLayer(composite, visParams, 'L8 Composite');
|
Map.addLayer(composite, visParams, 'L8 Composite');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The resulting composite (Fig. F4.3.1) has lots of clouds, especially in the western, mountainous regions of Colombia. In tropical regions, it is very challenging to generate a high-quality, cloud-free composite without first filtering images for cloud cover, even if our collection is constrained to only include images acquired during the dry season. Therefore, let’s filter our collection by the CLOUD_COVER parameter to avoid cloudy images. We will start with images that have less than 50% cloud cover.
|
The resulting composite (Fig. F4.3.1) has lots of clouds, especially in the western, mountainous regions of Colombia. In tropical regions, it is very challenging to generate a high-quality, cloud-free composite without first filtering images for cloud cover, even if our collection is constrained to only include images acquired during the dry season. Therefore, let’s filter our collection by the CLOUD_COVER parameter to avoid cloudy images. We will start with images that have less than 50% cloud cover.
|
||||||
@@ -817,14 +817,14 @@ print('Size landsat8 collection', landsat8.size());
|
|||||||
print('Size landsat8FiltClouds collection', landsat8FiltClouds.size());
|
print('Size landsat8FiltClouds collection', landsat8FiltClouds.size());
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
This new composite (Fig. F4.3.2) looks slightly better than the previous one, but still very cloudy. Remember to turn off the first layer or adjust the transparency to visualize only this new composite. The code prints the size of these collections, using the size function) to see how many images were left out after we applied the cloud cover threshold. (There are 1201 images in the landsat8 collection, compared to 493 in the landsat8FiltClouds collection—a lot of scenes with cloud cover greater than or equal to 50%.)
|
This new composite (Fig. F4.3.2) looks slightly better than the previous one, but still very cloudy. Remember to turn off the first layer or adjust the transparency to visualize only this new composite. The code prints the size of these collections, using the size function) to see how many images were left out after we applied the cloud cover threshold. (There are 1201 images in the landsat8 collection, compared to 493 in the landsat8FiltClouds collection—a lot of scenes with cloud cover greater than or equal to 50%.)
|
||||||
|
|
||||||
Try adjusting the CLOUD_COVER threshold in the landsat8FiltClouds variable to different percentages and checking the results. For example, with 20% set as the threshold (Fig. F4.3.3), you can see that many parts of the country have image gaps. (Remember to turn off the first layer or adjust its transparency; you can also set the shown parameter in the Map.addLayer function to false so the layer does not automatically load). So there is a trade-off between a stricter cloud cover threshold and data availability. Additionally, even with a cloud filter, some tiles still present a large area cover of clouds.
|
Try adjusting the CLOUD_COVER threshold in the landsat8FiltClouds variable to different percentages and checking the results. For example, with 20% set as the threshold (Fig. F4.3.3), you can see that many parts of the country have image gaps. (Remember to turn off the first layer or adjust its transparency; you can also set the shown parameter in the Map.addLayer function to false so the layer does not automatically load). So there is a trade-off between a stricter cloud cover threshold and data availability. Additionally, even with a cloud filter, some tiles still present a large area cover of clouds.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
This is due to persistent cloud cover in some regions of Colombia. However, a cloud mask can be applied to improve the results. The Landsat 8 Collection 2 contains a quality assessment (QA) band called QA_PIXEL that provides useful information on certain conditions within the data, and allows users to apply per-pixel filters. Each pixel in the QA band contains unsigned integers that represent bit-packed combinations of surface, atmospheric, and sensor conditions.
|
This is due to persistent cloud cover in some regions of Colombia. However, a cloud mask can be applied to improve the results. The Landsat 8 Collection 2 contains a quality assessment (QA) band called QA_PIXEL that provides useful information on certain conditions within the data, and allows users to apply per-pixel filters. Each pixel in the QA band contains unsigned integers that represent bit-packed combinations of surface, atmospheric, and sensor conditions.
|
||||||
@@ -848,14 +848,14 @@ var landsat8compositeMasked = landsat8FiltMasked.median().clip(country);
|
|||||||
Map.addLayer(landsat8compositeMasked, visParams, 'L8 composite masked');
|
Map.addLayer(landsat8compositeMasked, visParams, 'L8 composite masked');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Because we are dealing with bits, in the maskSrClouds function we utilized the bitwiseAnd and parseInt functions. These are functions that serve the purpose of unpacking the bit information. A bitwise AND is a binary operation that takes two equal-length binary representations and performs the logical AND operation on each pair of corresponding bits. Thus, if both bits in the compared positions have the value 1, the bit in the resulting binary representation is 1 (1 × 1 = 1); otherwise, the result is 0 (1 × 0 = 0 and 0 × 0 = 0). The parseInt function parses a string argument (in our case, five-character string '11111') and returns an integer of the specified numbering system, base 2.
|
Because we are dealing with bits, in the maskSrClouds function we utilized the bitwiseAnd and parseInt functions. These are functions that serve the purpose of unpacking the bit information. A bitwise AND is a binary operation that takes two equal-length binary representations and performs the logical AND operation on each pair of corresponding bits. Thus, if both bits in the compared positions have the value 1, the bit in the resulting binary representation is 1 (1 × 1 = 1); otherwise, the result is 0 (1 × 0 = 0 and 0 × 0 = 0). The parseInt function parses a string argument (in our case, five-character string '11111') and returns an integer of the specified numbering system, base 2.
|
||||||
|
|
||||||
The resulting composite (Fig. F4.3.4) shows masked clouds, and is more spatially exhaustive in coverage compared to previous composites (don’t forget to uncheck the previous layers). This is because, when compositing all the images into one, we are not taking cloudy pixels into account anymore; therefore, the resulting pixel is not cloud covered but an actual representation of the landscape. However, data gaps are still an issue due to cloud cover. If you do not specifically need an annual composite, a first approach is to create a two-year composite to try to mitigate the missing data issue, or to have a series of rules that allows for selecting pixels for that particular year (as in Sect. 3 below). Change the startDate variable to 2018-01-01 to include all images from 2018 and 2019 in the collection. How does the cloud-masked composite (Fig. F4.3.5) compare to the 2019 one?
|
The resulting composite (Fig. F4.3.4) shows masked clouds, and is more spatially exhaustive in coverage compared to previous composites (don’t forget to uncheck the previous layers). This is because, when compositing all the images into one, we are not taking cloudy pixels into account anymore; therefore, the resulting pixel is not cloud covered but an actual representation of the landscape. However, data gaps are still an issue due to cloud cover. If you do not specifically need an annual composite, a first approach is to create a two-year composite to try to mitigate the missing data issue, or to have a series of rules that allows for selecting pixels for that particular year (as in Sect. 3 below). Change the startDate variable to 2018-01-01 to include all images from 2018 and 2019 in the collection. How does the cloud-masked composite (Fig. F4.3.5) compare to the 2019 one?
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The resulting image has substantially fewer data gaps (you can zoom in to better see them). Again, if the time period is not a constraint for the creation of your composite, you can incorporate more images from a third year, and so on.
|
The resulting image has substantially fewer data gaps (you can zoom in to better see them). Again, if the time period is not a constraint for the creation of your composite, you can incorporate more images from a third year, and so on.
|
||||||
@@ -900,14 +900,14 @@ Map.addLayer(landsat7compositeMasked,
|
|||||||
max: 0.2 }, 'L7 composite masked');
|
max: 0.2 }, 'L7 composite masked');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Note that we used bands: ['SR_B3', 'SR_B2', 'SR_B1'] to visualize the composite because Landsat 7 has different band designations. The sensors aboard each of the Landsat satellites were designed to acquire data in different ranges of frequencies along the electromagnetic spectrum. Whereas for Landsat 8, the red, green, and blue bands are B4, B3, and B2, respectively, for Landsat 7, these same bands are B3, B2, and B1, respectively.
|
Note that we used bands: ['SR_B3', 'SR_B2', 'SR_B1'] to visualize the composite because Landsat 7 has different band designations. The sensors aboard each of the Landsat satellites were designed to acquire data in different ranges of frequencies along the electromagnetic spectrum. Whereas for Landsat 8, the red, green, and blue bands are B4, B3, and B2, respectively, for Landsat 7, these same bands are B3, B2, and B1, respectively.
|
||||||
|
|
||||||
You should see an image with systematic gaps like the one shown in Fig. F4.3.6 (remember to turn off the other layers, and zoom in to better see the data gaps). Landsat 7 was launched in 1999, but since 2003, the sensor has acquired and delivered data with data gaps caused by a scan line corrector (SLC) failure. Without an operating SLC, the sensor’s line of sight traces a zig-zag pattern along the satellite ground track, and, as a result, the imaged area is duplicated and some areas are missed. When the Level 1 data are processed, the duplicated areas are removed, leaving data gaps (Fig. F4.3.7). For more information about Landsat 7 and SLC error, please refer to the USGS Landsat 7 page. However, even with the SLC error, we can still use the Landsat 7 data in our composite. Now, let’s combine the Landsat 7 and 8 collections.
|
You should see an image with systematic gaps like the one shown in Fig. F4.3.6 (remember to turn off the other layers, and zoom in to better see the data gaps). Landsat 7 was launched in 1999, but since 2003, the sensor has acquired and delivered data with data gaps caused by a scan line corrector (SLC) failure. Without an operating SLC, the sensor’s line of sight traces a zig-zag pattern along the satellite ground track, and, as a result, the imaged area is duplicated and some areas are missed. When the Level 1 data are processed, the duplicated areas are removed, leaving data gaps (Fig. F4.3.7). For more information about Landsat 7 and SLC error, please refer to the USGS Landsat 7 page. However, even with the SLC error, we can still use the Landsat 7 data in our composite. Now, let’s combine the Landsat 7 and 8 collections.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Since Landsat 7 and 8 have different band designations, first we create a function to rename the bands from Landsat 7 to match the names used for Landsat 8 and map that function over our Landsat 7 collection.
|
Since Landsat 7 and 8 have different band designations, first we create a function to rename the bands from Landsat 7 to match the names used for Landsat 8 and map that function over our Landsat 7 collection.
|
||||||
@@ -926,7 +926,7 @@ var landsat7FiltMaskedRenamed = landsat7FiltMasked.map(rename);
|
|||||||
```
|
```
|
||||||
If you print the first images of both the landsat7FiltMasked and landsat7FiltMaskedRenamed collections (Fig. F4.3.8), you will see that the bands got renamed, and not all bands got copied over (SR_ATMOS_OPACITY, SR_CLOUD_QA, SR_B6, etc.). To copy these additional bands, simply add them to the rename function. You will need to rename SR_B6 so it does not have the same name as the new band 5.
|
If you print the first images of both the landsat7FiltMasked and landsat7FiltMaskedRenamed collections (Fig. F4.3.8), you will see that the bands got renamed, and not all bands got copied over (SR_ATMOS_OPACITY, SR_CLOUD_QA, SR_B6, etc.). To copy these additional bands, simply add them to the rename function. You will need to rename SR_B6 so it does not have the same name as the new band 5.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now we merge the two collections using the merge function for ImageCollection and mapping over a function to cast the Landsat 7 input values to a 32-bit float using the toFloat function for consistency. To merge collections, the number and names of the bands must be the same in each collection. We use the select function (Chap. F1.1) to select the Landsat 8 bands to be the same as Landsat 7’s. When creating the new Landsat 7 and 8 composite, if we did not select these 6 bands, we would get an error message for trying to composite a collection that has 6 bands (Landsat 7) with a collection that has 19 bands (Landsat 8).
|
Now we merge the two collections using the merge function for ImageCollection and mapping over a function to cast the Landsat 7 input values to a 32-bit float using the toFloat function for consistency. To merge collections, the number and names of the bands must be the same in each collection. We use the select function (Chap. F1.1) to select the Landsat 8 bands to be the same as Landsat 7’s. When creating the new Landsat 7 and 8 composite, if we did not select these 6 bands, we would get an error message for trying to composite a collection that has 6 bands (Landsat 7) with a collection that has 19 bands (Landsat 8).
|
||||||
@@ -951,7 +951,7 @@ Map.addLayer(landsat78composite, visParams, 'L7 and L8 composite');
|
|||||||
```
|
```
|
||||||
Comparing the composite generated considering both Landsat 7 and 8 to the Landsat 8-only composite, it is evident that there is a reduction in the amount of data gaps in the final result (Fig. F4.3.9). The resulting Landsat 7 and 8 image composite still has data gaps due to the presence of clouds and Landsat 7’s SLC-off data. You can try setting the center of the map to the point with latitude 3.6023 and longitude −75.0741 to see the inset example of Fig. F4.3.9.
|
Comparing the composite generated considering both Landsat 7 and 8 to the Landsat 8-only composite, it is evident that there is a reduction in the amount of data gaps in the final result (Fig. F4.3.9). The resulting Landsat 7 and 8 image composite still has data gaps due to the presence of clouds and Landsat 7’s SLC-off data. You can try setting the center of the map to the point with latitude 3.6023 and longitude −75.0741 to see the inset example of Fig. F4.3.9.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -964,7 +964,7 @@ This section presents an Earth Engine application that enables the generation of
|
|||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
Code Checkpoint F43c. The book’s repository contains information about accessing the GEE-BAP interface and its related functions.
|
Code Checkpoint F43c. The book’s repository contains information about accessing the GEE-BAP interface and its related functions.
|
||||||
:::
|
:::
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Once you have loaded the GEE-BAP interface (Fig. F4.3.10) using the instructions in the Code Checkpoint, you will notice that it is divided into three sections: (1) Input/Output options, (2) Pixel scoring options, and (3) Advanced parameters. Users indicate the study area, the time period for generating annual BAP composites (i.e., start and end years), and the path to store the results in the Input/Output options. Users have three options to define the study area. The Draw study area option uses the Draw a shape and Draw a rectangle tools to define the area of interest. The Upload image template option utilizes an image template uploaded by the user in TIFF format. This option is well suited to generating BAP composites that match the projection, pixel size, and extent to existing raster datasets. The Work globally option generates BAP composites for the entire globe; note that when this option is selected, complete data download is not available due to the Earth’s size. With Start year and End year, users can indicate the beginning and end of the annual time series of BAP image composites to be generated. Multiple image composites are then generated—one composite for each year—resulting in a time series of annual composites. For each year, composites are uniquely generated utilizing images acquired on the days within the specified Date range. Produced BAP composites can be saved in the indicated (Path) Google Drive folder using the Tasks tab. Results are generated in a tiled, TIFF format, accompanied by a CSV file that indicates the parameters used to construct the composite.
|
Once you have loaded the GEE-BAP interface (Fig. F4.3.10) using the instructions in the Code Checkpoint, you will notice that it is divided into three sections: (1) Input/Output options, (2) Pixel scoring options, and (3) Advanced parameters. Users indicate the study area, the time period for generating annual BAP composites (i.e., start and end years), and the path to store the results in the Input/Output options. Users have three options to define the study area. The Draw study area option uses the Draw a shape and Draw a rectangle tools to define the area of interest. The Upload image template option utilizes an image template uploaded by the user in TIFF format. This option is well suited to generating BAP composites that match the projection, pixel size, and extent to existing raster datasets. The Work globally option generates BAP composites for the entire globe; note that when this option is selected, complete data download is not available due to the Earth’s size. With Start year and End year, users can indicate the beginning and end of the annual time series of BAP image composites to be generated. Multiple image composites are then generated—one composite for each year—resulting in a time series of annual composites. For each year, composites are uniquely generated utilizing images acquired on the days within the specified Date range. Produced BAP composites can be saved in the indicated (Path) Google Drive folder using the Tasks tab. Results are generated in a tiled, TIFF format, accompanied by a CSV file that indicates the parameters used to construct the composite.
|
||||||
@@ -981,7 +981,7 @@ Finally, there is a Landsat 7 ETM+ SLC-off penalty scoring function that de-emph
|
|||||||
|
|
||||||
By default, the GEE-BAP application produces image composites using all the visible bands. The Spectral index option enables the user to produce selected spectral indices from the resulting BAP image composites. Available spectral indices include: Normalized Difference Vegetation Index (NDVI, Fig. F4.3.11), Enhanced Vegetation Index (EVI), and Normalized Burn Ratio (NBR), as well as several indices derived from the Tasseled Cap transformation: Wetness (TCW), Greenness (TCG), Brightness (TCB), and Angle (TCA). Composited indices are able to be downloaded as well as viewed on the map.
|
By default, the GEE-BAP application produces image composites using all the visible bands. The Spectral index option enables the user to produce selected spectral indices from the resulting BAP image composites. Available spectral indices include: Normalized Difference Vegetation Index (NDVI, Fig. F4.3.11), Enhanced Vegetation Index (EVI), and Normalized Burn Ratio (NBR), as well as several indices derived from the Tasseled Cap transformation: Wetness (TCW), Greenness (TCG), Brightness (TCB), and Angle (TCA). Composited indices are able to be downloaded as well as viewed on the map.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
GEE-BAP functions can be accessed programmatically, including pixel scoring parameters, as well as BAP image compositing (BAP), de-spiking (despikeCollection), data-gap infilling (infill), and displaying (ShowCollection) functions. The following code sets the scoring parameter values, then generates and displays the compositing results (Fig. F4.3.12) for a BAP composite that is de-spiked, with data gaps infilled using temporal interpolation. Copy and paste the code below into a new script.
|
GEE-BAP functions can be accessed programmatically, including pixel scoring parameters, as well as BAP image compositing (BAP), de-spiking (despikeCollection), data-gap infilling (infill), and displaying (ShowCollection) functions. The following code sets the scoring parameter values, then generates and displays the compositing results (Fig. F4.3.12) for a BAP composite that is de-spiked, with data gaps infilled using temporal interpolation. Copy and paste the code below into a new script.
|
||||||
@@ -1023,7 +1023,7 @@ library.ShowCollection(BAPCS, startYear, endYear, colombia, false, null);
|
|||||||
library.AddSLider(startYear, endYear);
|
library.AddSLider(startYear, endYear);
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -1123,19 +1123,19 @@ Change detection is the process of assessing how landscape conditions are changi
|
|||||||
|
|
||||||
a)
|
a)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
b)
|
b)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
c)
|
c)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
d)
|
d)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Many change detection techniques use the same basic premise: that most changes on the landscape result in spectral values that differ between pre-event and post-event images. The challenge can be to separate the real changes of interest—those due to activities on the landscape—from noise in the spectral signal, which can be caused by seasonal variation and phenology, image misregistration, clouds and shadows, radiometric inconsistencies, variability in illumination (e.g., sun angle, sensor position), and atmospheric effects.
|
Many change detection techniques use the same basic premise: that most changes on the landscape result in spectral values that differ between pre-event and post-event images. The challenge can be to separate the real changes of interest—those due to activities on the landscape—from noise in the spectral signal, which can be caused by seasonal variation and phenology, image misregistration, clouds and shadows, radiometric inconsistencies, variability in illumination (e.g., sun angle, sensor position), and atmospheric effects.
|
||||||
@@ -1147,7 +1147,7 @@ For land cover changes that occur abruptly over large areas on the landscape and
|
|||||||
|
|
||||||
For the practicum, you will select pre-event and post-event image scenes and investigate the conditions in these images in a false-color composite display. Next, you will calculate the NBR index for each scene and create a difference image using the two NBR maps. Finally, you will apply a threshold to the difference image to establish categories of changed versus stable areas (Fig. F4.4.2).
|
For the practicum, you will select pre-event and post-event image scenes and investigate the conditions in these images in a false-color composite display. Next, you will calculate the NBR index for each scene and create a difference image using the two NBR maps. Finally, you will apply a threshold to the difference image to establish categories of changed versus stable areas (Fig. F4.4.2).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Preparing Imagery
|
### Preparing Imagery
|
||||||
@@ -1198,7 +1198,7 @@ Map.addLayer(preImage, visParam, 'pre');
|
|||||||
Map.addLayer(postImage, visParam, 'post');
|
Map.addLayer(postImage, visParam, 'post');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Calculating NBR
|
### Calculating NBR
|
||||||
@@ -1246,7 +1246,7 @@ The color ramp has dark blues for the lowest values, greens and oranges in the m
|
|||||||
|
|
||||||
a) b) c)
|
a) b) c)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Classifying Change
|
### Classifying Change
|
||||||
@@ -1279,11 +1279,11 @@ Map.addLayer(diffClassified.selfMask(),
|
|||||||
```
|
```
|
||||||
a)
|
a)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
b)
|
b)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Chapters F4.5 through F4.9 present more-advanced change detection algorithms that go beyond differencing and thresholding between two images, instead allowing you to analyze changes indicated across several images as a time series.
|
Chapters F4.5 through F4.9 present more-advanced change detection algorithms that go beyond differencing and thresholding between two images, instead allowing you to analyze changes indicated across several images as a time series.
|
||||||
@@ -1381,14 +1381,14 @@ Second, can you identify fitting parameters that allow the algorithm to capture
|
|||||||
|
|
||||||
The best way to begin assessing these questions is to look at the time series of individual pixels. In Earth Engine, open and run the script that generates the GUI we have developed to easily deploy the LandTrendr algorithms. Run the script, and you should see an interface that looks like the one shown in Fig. 4.5.1.
|
The best way to begin assessing these questions is to look at the time series of individual pixels. In Earth Engine, open and run the script that generates the GUI we have developed to easily deploy the LandTrendr algorithms. Run the script, and you should see an interface that looks like the one shown in Fig. 4.5.1.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The LandTrendr GUI consists of three panels: a control panel on the left, a reporting panel on the right, and a Map panel in the center. The control panel is where all of the functionality of the interface resides. There are several modules,and each is accessed by clicking on the double arrow to the right of the title. The Map panel defaults to a location in Oregon but can be manually moved anywhere in the world. The reporting panel shows messages about how to use functions, as well as providing graphical outputs.
|
The LandTrendr GUI consists of three panels: a control panel on the left, a reporting panel on the right, and a Map panel in the center. The control panel is where all of the functionality of the interface resides. There are several modules,and each is accessed by clicking on the double arrow to the right of the title. The Map panel defaults to a location in Oregon but can be manually moved anywhere in the world. The reporting panel shows messages about how to use functions, as well as providing graphical outputs.
|
||||||
|
|
||||||
Next, expand the “Pixel Time Series Options” function. For now, simply use your mouse to click somewhere on the map. Wait a few seconds even though it looks like nothing is happening – be patient!! The GUI has sent information to Earth Engine to run the LandTrendr algorithms at the location you have clicked, and is waiting for the results. Eventually you should see a chart appear in the reporting panel on the right. Fig. 4.5.2 shows what one pixel looks like in an area where the forest burned and began regrowth. Your chart will probably look different.
|
Next, expand the “Pixel Time Series Options” function. For now, simply use your mouse to click somewhere on the map. Wait a few seconds even though it looks like nothing is happening – be patient!! The GUI has sent information to Earth Engine to run the LandTrendr algorithms at the location you have clicked, and is waiting for the results. Eventually you should see a chart appear in the reporting panel on the right. Fig. 4.5.2 shows what one pixel looks like in an area where the forest burned and began regrowth. Your chart will probably look different.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The key to success with the LandTrendr algorithm is interpreting these time series. First, let’s examine the components of the chart. The x-axis shows the year of observation. With LandTrendr, only one observation per year is used to describe the history of a pixel; later, we will cover how you control that value. The y-axis shows the spectral value of the index that is chosen. In the default mode, the Normalized Burn Ratio (as described in Chap. F4.4). Note that you also have the ability to pick more indices using the checkboxes on the control panel on the left. Note that we scale floating point (decimal) indices by 1000. Thus, an NBR value of 1.0 would be displayed as 1000.
|
The key to success with the LandTrendr algorithm is interpreting these time series. First, let’s examine the components of the chart. The x-axis shows the year of observation. With LandTrendr, only one observation per year is used to describe the history of a pixel; later, we will cover how you control that value. The y-axis shows the spectral value of the index that is chosen. In the default mode, the Normalized Burn Ratio (as described in Chap. F4.4). Note that you also have the ability to pick more indices using the checkboxes on the control panel on the left. Note that we scale floating point (decimal) indices by 1000. Thus, an NBR value of 1.0 would be displayed as 1000.
|
||||||
@@ -1401,7 +1401,7 @@ Next, translate that change into the changes of interest for the change processe
|
|||||||
|
|
||||||
In the case of Fig. 4.5.2, we interpret the abrupt drop as a disturbance, and the subsequent rise of the index as regrowth or recovery (though not necessarily to the same type of vegetation).
|
In the case of Fig. 4.5.2, we interpret the abrupt drop as a disturbance, and the subsequent rise of the index as regrowth or recovery (though not necessarily to the same type of vegetation).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Tip: LandTrendr is able to accept any index, and advanced users are welcome to use indices of their own design. An important consideration is knowing which direction indicates “recovery” and “disturbance” for the topic you are interested in. The algorithms favor detection of disturbance and can be controlled to constrain how quickly recovery is assumed to occur (see parameters below).
|
Tip: LandTrendr is able to accept any index, and advanced users are welcome to use indices of their own design. An important consideration is knowing which direction indicates “recovery” and “disturbance” for the topic you are interested in. The algorithms favor detection of disturbance and can be controlled to constrain how quickly recovery is assumed to occur (see parameters below).
|
||||||
@@ -1412,7 +1412,7 @@ One option is to change the index. Any single index is simply one view of the la
|
|||||||
|
|
||||||
Another option is to change the date range. LandTrendr uses one value per year, but the value that is chosen can be controlled by the user. It’s possible that the change of interest is better identified in some seasons than others. We use a medoid image compositing approach, which picks the best single observation each year from a date range of images in an ImageCollection. In the GUI, you can change the date range of imagery used for compositing in the Image Collection portion of the LandTrendr Options menu (Fig. F4.5.4).
|
Another option is to change the date range. LandTrendr uses one value per year, but the value that is chosen can be controlled by the user. It’s possible that the change of interest is better identified in some seasons than others. We use a medoid image compositing approach, which picks the best single observation each year from a date range of images in an ImageCollection. In the GUI, you can change the date range of imagery used for compositing in the Image Collection portion of the LandTrendr Options menu (Fig. F4.5.4).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Change the Start Date and End Date to find a time of year when the distinction between cover conditions before and during the change process of interest is greatest.
|
Change the Start Date and End Date to find a time of year when the distinction between cover conditions before and during the change process of interest is greatest.
|
||||||
@@ -1449,7 +1449,7 @@ There are three post-processing steps to convert a segmented trajectory to a map
|
|||||||
|
|
||||||
Theory: We’ll start with a single pixel to learn how to Interpret a disturbance pixel time series in terms of the dominant disturbance segment. For the disturbance time series we have used in figures above, we can identify the key parameters of the segment associated with the disturbance. For the example above, we have extracted the actual NBR values of the fitted time series and noted them in a table (Fig. 4.5.5). This is not part of the GUI – it is simply used here to work through the concepts.
|
Theory: We’ll start with a single pixel to learn how to Interpret a disturbance pixel time series in terms of the dominant disturbance segment. For the disturbance time series we have used in figures above, we can identify the key parameters of the segment associated with the disturbance. For the example above, we have extracted the actual NBR values of the fitted time series and noted them in a table (Fig. 4.5.5). This is not part of the GUI – it is simply used here to work through the concepts.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
From the table shown in Fig. 4.5.5, we can infer several key things about this pixel:
|
From the table shown in Fig. 4.5.5, we can infer several key things about this pixel:
|
||||||
@@ -1466,7 +1466,7 @@ If we wanted to map the magnitude of the disturbance, we would follow the same f
|
|||||||
|
|
||||||
The LandTrendr GUI provides a set of tools to easily apply the same logic rules to all pixels of interest and create maps. Click on the Change Filter Options menu. The interface shown in Fig. 4.5.6 appears.
|
The LandTrendr GUI provides a set of tools to easily apply the same logic rules to all pixels of interest and create maps. Click on the Change Filter Options menu. The interface shown in Fig. 4.5.6 appears.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The first two sections are used to identify the segments of interest.
|
The first two sections are used to identify the segments of interest.
|
||||||
@@ -1479,12 +1479,12 @@ Each filter (magnitude, duration, etc.) is used to further winnow the possible s
|
|||||||
|
|
||||||
If you’re following along and making changes, or if you’re just using the default location and parameters, click the Add Filtered Disturbance Imagery to add this to the map. You should see something like Fig. 4.5.7.
|
If you’re following along and making changes, or if you’re just using the default location and parameters, click the Add Filtered Disturbance Imagery to add this to the map. You should see something like Fig. 4.5.7.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
There are multiple layers of disturbance added to the map. Use the map layers checkboxes to change which is shown. Magnitude of disturbance, for example, is a map of the delta change between beginning and endpoints of the segments (Fig. 4.5.8).
|
There are multiple layers of disturbance added to the map. Use the map layers checkboxes to change which is shown. Magnitude of disturbance, for example, is a map of the delta change between beginning and endpoints of the segments (Fig. 4.5.8).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Conclusion {.unnumbered}
|
### Conclusion {.unnumbered}
|
||||||
@@ -1567,7 +1567,7 @@ Higher-dimension band values: array images. That more complex conception of the
|
|||||||
|
|
||||||
First, we will give some very basic notation (Fig. F4.6.1). A scalar pixel at time t is given by pt, and a pixel vector by pt. A variable with a “hat” represents an estimated value: in this context, p̂t is the estimated pixel value at time t. A time series is a collection of pixel values, usually sorted chronologically: {pt; t = t0...tN}, where t might be in any units, t0 is the smallest, and tN is the largest such t in the series.
|
First, we will give some very basic notation (Fig. F4.6.1). A scalar pixel at time t is given by pt, and a pixel vector by pt. A variable with a “hat” represents an estimated value: in this context, p̂t is the estimated pixel value at time t. A time series is a collection of pixel values, usually sorted chronologically: {pt; t = t0...tN}, where t might be in any units, t0 is the smallest, and tN is the largest such t in the series.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Data Preparation and Preprocessing
|
### Data Preparation and Preprocessing
|
||||||
@@ -1648,7 +1648,7 @@ var landsat8Chart = ui.Chart.image.series(landsat8sr.select('NDVI'), roi)
|
|||||||
print(landsat8Chart);
|
print(landsat8Chart);
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can add a linear trend line to our chart using the trendlines parameters in the setOptions function for image series charts. Copy and paste the code below to print the same chart but with a linear trend line plotted (Fig. F4.6.3). In the next section, you will learn how to estimate linear trends over time.
|
We can add a linear trend line to our chart using the trendlines parameters in the setOptions function for image series charts. Copy and paste the code below to print the same chart but with a linear trend line plotted (Fig. F4.6.3). In the next section, you will learn how to estimate linear trends over time.
|
||||||
@@ -1669,7 +1669,7 @@ var landsat8ChartTL = ui.Chart.image.series(landsat8sr.select('NDVI'), roi)
|
|||||||
print(landsat8ChartTL);
|
print(landsat8ChartTL);
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now that we have plotted and visualized the data, lots of interesting analyses can be done to the time series by harnessing Earth Engine tools for fitting curves through this data. We will see a couple of examples in the following sections.
|
Now that we have plotted and visualized the data, lots of interesting analyses can be done to the time series by harnessing Earth Engine tools for fitting curves through this data. We will see a couple of examples in the following sections.
|
||||||
@@ -1716,7 +1716,7 @@ Map.addLayer(coefficients, {}, 'coefficients image');
|
|||||||
```
|
```
|
||||||
If you click over a point using the Inspector tab, you will see the pixel values for the array image (coefficients “t” and “constant”, and residuals) and two-band image (coefficients “t” and “constant”) (Fig. F4.6.4).
|
If you click over a point using the Inspector tab, you will see the pixel values for the array image (coefficients “t” and “constant”, and residuals) and two-band image (coefficients “t” and “constant”) (Fig. F4.6.4).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Now, copy and paste the code below to use the model to detrend the original NDVI time series and plot the time series chart with the trendlines parameter (Fig. F4.6.5).
|
Now, copy and paste the code below to use the model to detrend the original NDVI time series and plot the time series chart with the trendlines parameter (Fig. F4.6.5).
|
||||||
@@ -1742,7 +1742,7 @@ var detrendedChart = ui.Chart.image.series(detrended, roi, null, 30)
|
|||||||
});print(detrendedChart);
|
});print(detrendedChart);
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -1804,14 +1804,14 @@ print(ui.Chart.image.series(
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Returning to the mind-bending nature of curve-fitting, it is worth remembering that the harmonic waves seen in Fig. F4.6.6 are the fit of the data to a single point across the image. Next, we will map the outcomes of millions of these fits, pixel by pixel, across the entire study area.
|
Returning to the mind-bending nature of curve-fitting, it is worth remembering that the harmonic waves seen in Fig. F4.6.6 are the fit of the data to a single point across the image. Next, we will map the outcomes of millions of these fits, pixel by pixel, across the entire study area.
|
||||||
|
|
||||||
We’ll compute and map the phase and amplitude of the estimated harmonic model for each pixel. Phase and amplitude (Fig. F4.6.7) can give us additional information to facilitate remote sensing applications such as agricultural mapping and land use and land cover monitoring. Agricultural crops with different phenological cycles can be distinguished with phase and amplitude information, something that perhaps would not be possible with spectral information alone.
|
We’ll compute and map the phase and amplitude of the estimated harmonic model for each pixel. Phase and amplitude (Fig. F4.6.7) can give us additional information to facilitate remote sensing applications such as agricultural mapping and land use and land cover monitoring. Agricultural crops with different phenological cycles can be distinguished with phase and amplitude information, something that perhaps would not be possible with spectral information alone.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Copy and paste the code below to compute phase and amplitude from the coefficients and add this image to the map (Fig. F4.6.8).
|
Copy and paste the code below to compute phase and amplitude from the coefficients and add this image to the map (Fig. F4.6.8).
|
||||||
@@ -1841,7 +1841,7 @@ var rgb = ee.Image.cat([
|
|||||||
Map.addLayer(rgb, {}, 'phase (hue), amplitude (sat), ndvi (val)');
|
Map.addLayer(rgb, {}, 'phase (hue), amplitude (sat), ndvi (val)');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The code uses the HSV to RGB transformation hsvToRgb for visualization purposes (Chap. F3.1). We use this transformation to separate color components from intensity for a better visualization. Without this transformation, we would visualize a very colorful image that would not look as intuitive as the image with the transformation. With this transformation, phase, amplitude, and mean NDVI are displayed in terms of hue (color), saturation (difference from white), and value (difference from black), respectively. Therefore, darker pixels are areas with low NDVI. For example, water bodies will appear as black, since NDVI values are zero or negative. The different colors are distinct phase values, and the saturation of the color refers to the amplitude: whiter colors mean amplitude closer to zero (e.g., forested areas), and the more vivid the colors, the higher the amplitude (e.g., croplands). Note that if you use the Inspector tool to analyze the values of a pixel, you will not get values of phase, amplitude, and NDVI, but the transformed values into values of blue, green, and red colors.
|
The code uses the HSV to RGB transformation hsvToRgb for visualization purposes (Chap. F3.1). We use this transformation to separate color components from intensity for a better visualization. Without this transformation, we would visualize a very colorful image that would not look as intuitive as the image with the transformation. With this transformation, phase, amplitude, and mean NDVI are displayed in terms of hue (color), saturation (difference from white), and value (difference from black), respectively. Therefore, darker pixels are areas with low NDVI. For example, water bodies will appear as black, since NDVI values are zero or negative. The different colors are distinct phase values, and the saturation of the color refers to the amplitude: whiter colors mean amplitude closer to zero (e.g., forested areas), and the more vivid the colors, the higher the amplitude (e.g., croplands). Note that if you use the Inspector tool to analyze the values of a pixel, you will not get values of phase, amplitude, and NDVI, but the transformed values into values of blue, green, and red colors.
|
||||||
@@ -1875,9 +1875,9 @@ Map.addLayer(anotherView,
|
|||||||
max: 0.03 }, 'Another combination of fit characteristics');
|
max: 0.03 }, 'Another combination of fit characteristics');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The upper image in Fig. F4.6.9 is a closer view of Fig. F4.6.8, showing an image that transforms the sine and cosine coefficient values, and incorporates information from the mean NDVI. The lower image draws the sine and cosine in the red and blue bands, and extracts the slope of the linear trend that you calculated earlier in the chapter, placing that in the green band. The two views of the fit are similarly structured in their spatial pattern—both show fields to the west and the city to the east. But the pixel-by-pixel variability emphasizes a key point of this chapter: that a fit to the NDVI data is done independently in each pixel in the image. Using different elements of the fit, these two views, like other combinations of the data you might imagine, can reveal the rich variability of the landscape around Modesto.
|
The upper image in Fig. F4.6.9 is a closer view of Fig. F4.6.8, showing an image that transforms the sine and cosine coefficient values, and incorporates information from the mean NDVI. The lower image draws the sine and cosine in the red and blue bands, and extracts the slope of the linear trend that you calculated earlier in the chapter, placing that in the green band. The two views of the fit are similarly structured in their spatial pattern—both show fields to the west and the city to the east. But the pixel-by-pixel variability emphasizes a key point of this chapter: that a fit to the NDVI data is done independently in each pixel in the image. Using different elements of the fit, these two views, like other combinations of the data you might imagine, can reveal the rich variability of the landscape around Modesto.
|
||||||
@@ -1894,11 +1894,11 @@ Code Checkpoint F46e. The book’s repository contains a script to use to begin
|
|||||||
:::
|
:::
|
||||||
Beginning with the repository script, changing the value of the harmonics variable will change the complexity of the harmonic curve fit by superimposing more or fewer harmonic waves on each other. While fitting higher-order functions improves the goodness-of-fit of the model to a given set of data, many of the coefficients may be close to zero at higher numbers or harmonic terms. Fig. F4.6.10 shows the fit through the example point using one, two, and three harmonic curves.
|
Beginning with the repository script, changing the value of the harmonics variable will change the complexity of the harmonic curve fit by superimposing more or fewer harmonic waves on each other. While fitting higher-order functions improves the goodness-of-fit of the model to a given set of data, many of the coefficients may be close to zero at higher numbers or harmonic terms. Fig. F4.6.10 shows the fit through the example point using one, two, and three harmonic curves.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Conclusion {.unnumbered}
|
### Conclusion {.unnumbered}
|
||||||
@@ -1975,7 +1975,7 @@ Once you have loaded the CCDC interface (Fig. F4.7.1), you will be able to navig
|
|||||||
|
|
||||||
Pay special attention to the characteristics of each segment. For example, look at the average surface reflectance value for each segment. The presence of a pronounced slope may be indicative of phenomena like vegetation regrowth or degradation. The number of harmonics used in each segment may represent seasonality in vegetation (either natural or due to agricultural practices) or landscape dynamics (e.g., seasonal flooding).
|
Pay special attention to the characteristics of each segment. For example, look at the average surface reflectance value for each segment. The presence of a pronounced slope may be indicative of phenomena like vegetation regrowth or degradation. The number of harmonics used in each segment may represent seasonality in vegetation (either natural or due to agricultural practices) or landscape dynamics (e.g., seasonal flooding).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Question 1. While still using the SWIR1 band, click on a pixel that is forested. What do the time series and time segments look like?
|
Question 1. While still using the SWIR1 band, click on a pixel that is forested. What do the time series and time segments look like?
|
||||||
@@ -2175,14 +2175,14 @@ Map.addLayer(selectedMag, magVisParams, 'Max mag');
|
|||||||
Map.addLayer(selectedTbreak, timeVisParams, 'Time of max mag');
|
Map.addLayer(selectedTbreak, timeVisParams, 'Time of max mag');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We first take the absolute value because the magnitudes can be positive or negative, depending on the direction of the change and the band used. For example, a positive value in the SWIR1 may show a forest loss event, where surface reflectance goes from low to higher values. Brighter values in Fig. 4.7.3 represent events of that type. Conversely, a flooding event would have a negative value, due to the corresponding drop in reflectance. Once we find the maximum absolute value, we find its position on the array and then use that index to extract the original magnitude value, as well as the time when that break occurred.
|
We first take the absolute value because the magnitudes can be positive or negative, depending on the direction of the change and the band used. For example, a positive value in the SWIR1 may show a forest loss event, where surface reflectance goes from low to higher values. Brighter values in Fig. 4.7.3 represent events of that type. Conversely, a flooding event would have a negative value, due to the corresponding drop in reflectance. Once we find the maximum absolute value, we find its position on the array and then use that index to extract the original magnitude value, as well as the time when that break occurred.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -2257,7 +2257,7 @@ Map.addLayer(intercept.arrayFlatten([
|
|||||||
]), intVisParams, 'INTP_SWIR1');
|
]), intVisParams, 'INTP_SWIR1');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Since we run the CCDC algorithm on Landsat surface reflectance images, intercept values should represent the average reflectance of a segment. However, if you click on the image, you will see that the values are outside of the 0–1 range. This is because the intercept is calculated by the CCDC algorithm for the origin (e.g., time 0), and not for the year we requested. In order to retrieve the adjusted intercept, as well as other coefficients, we will use a different approach.
|
Since we run the CCDC algorithm on Landsat surface reflectance images, intercept values should represent the average reflectance of a segment. However, if you click on the image, you will see that the values are outside of the 0–1 range. This is because the intercept is calculated by the CCDC algorithm for the origin (e.g., time 0), and not for the year we requested. In order to retrieve the adjusted intercept, as well as other coefficients, we will use a different approach.
|
||||||
@@ -2353,14 +2353,14 @@ Map.addLayer(coefs, rgbVisParams, 'RGB 2005-09-25');
|
|||||||
```
|
```
|
||||||
The slope and RMSE images are shown in Fig. 4.7.5. For the slopes, high positive values are bright, while large negative values are very dark. Most of the remaining forest is stable and has a slope close to zero, while areas that have experienced transformation and show agricultural activity tend to have positive slopes in the RED band, appearing bright in the image. Similarly, for the RMSE image, stable forests present more predictable time series of surface reflectance that are captured more faithfully by the time segments, and therefore present lower RMSE values, appearing darker in the image. Agricultural areas present noisier time series that are more challenging to model, and result in higher RMSE values, appearing brighter.
|
The slope and RMSE images are shown in Fig. 4.7.5. For the slopes, high positive values are bright, while large negative values are very dark. Most of the remaining forest is stable and has a slope close to zero, while areas that have experienced transformation and show agricultural activity tend to have positive slopes in the RED band, appearing bright in the image. Similarly, for the RMSE image, stable forests present more predictable time series of surface reflectance that are captured more faithfully by the time segments, and therefore present lower RMSE values, appearing darker in the image. Agricultural areas present noisier time series that are more challenging to model, and result in higher RMSE values, appearing brighter.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Finally, the RGB image we created is shown in Fig. 4.7.6. The intercepts are calculated for the middle point of the time segment intercepting the date we requested, representing the average reflectance for the span of the selected segment. In that sense, when shown together as an RGB image, they are similar to a composite image for the selected date, with the advantage of always being cloud-free.
|
Finally, the RGB image we created is shown in Fig. 4.7.6. The intercepts are calculated for the middle point of the time segment intercepting the date we requested, representing the average reflectance for the span of the selected segment. In that sense, when shown together as an RGB image, they are similar to a composite image for the selected date, with the advantage of always being cloud-free.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -2479,7 +2479,7 @@ Code Checkpoint F48a. The book’s repository contains a script that shows what
|
|||||||
To see if BULC can successfully sift through these Events, we will use BULC’s GUI (Fig. F4.8.1), which makes interacting with the functionality straightforward. :::{.callout-note}
|
To see if BULC can successfully sift through these Events, we will use BULC’s GUI (Fig. F4.8.1), which makes interacting with the functionality straightforward. :::{.callout-note}
|
||||||
Code Checkpoint F48b in the book’s repository contains information about accessing that interface.
|
Code Checkpoint F48b in the book’s repository contains information about accessing that interface.
|
||||||
:::
|
:::
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
After you have run the script, BULC’s interface requires that a few parameters be set; these are specified using the left panel. Here, we describe and populate each of the required parameters, which are shown in red. As you proceed, the default red color will change to green when a parameter receives a value.
|
After you have run the script, BULC’s interface requires that a few parameters be set; these are specified using the left panel. Here, we describe and populate each of the required parameters, which are shown in red. As you proceed, the default red color will change to green when a parameter receives a value.
|
||||||
@@ -2500,7 +2500,7 @@ BULC makes relatively small demands on memory since its arithmetic uses only mul
|
|||||||
|
|
||||||
When you have finished setting the required parameters, the interface will look like Fig. 4.8.2.
|
When you have finished setting the required parameters, the interface will look like Fig. 4.8.2.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Beneath the required parameters is a set of optional parameters that affect which intermediate results are stored during a run for later inspection. We are also given a choice of returning intermediate results for closer inspection. At this stage, you can leave all optional parameters out of the BULC call by leaving them blanked or unchecked.
|
Beneath the required parameters is a set of optional parameters that affect which intermediate results are stored during a run for later inspection. We are also given a choice of returning intermediate results for closer inspection. At this stage, you can leave all optional parameters out of the BULC call by leaving them blanked or unchecked.
|
||||||
@@ -2511,9 +2511,9 @@ The BULC interpretation of the landscape looks roughly like the Event inputs, bu
|
|||||||
|
|
||||||
Meanwhile, below the Console, the rest of the interface changes when BULC is run. The Map panel displays BULC’s classification for the final date: that is, after considering the evidence from each of the input classifications. We can use the Satellite background to judge whether BULC is accurately capturing the state of LULC. This can be done by unselecting the drawn layers in the map layer set and selecting Satellite from the choices in the upper-right part of the Map panel. Earth Engine’s background satellite images are often updated, so you should see something like the right side of Fig. F4.8.3, though it may differ slightly.
|
Meanwhile, below the Console, the rest of the interface changes when BULC is run. The Map panel displays BULC’s classification for the final date: that is, after considering the evidence from each of the input classifications. We can use the Satellite background to judge whether BULC is accurately capturing the state of LULC. This can be done by unselecting the drawn layers in the map layer set and selecting Satellite from the choices in the upper-right part of the Map panel. Earth Engine’s background satellite images are often updated, so you should see something like the right side of Fig. F4.8.3, though it may differ slightly.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Question 1. When comparing the BULC classification for 2021 against the current Earth Engine satellite view, what are the similarities and differences? Note that in Earth Engine, the copyrighted year numbers at the bottom of the screen may not coincide with the precise date of the image shown.
|
Question 1. When comparing the BULC classification for 2021 against the current Earth Engine satellite view, what are the similarities and differences? Note that in Earth Engine, the copyrighted year numbers at the bottom of the screen may not coincide with the precise date of the image shown.
|
||||||
@@ -2531,9 +2531,9 @@ Question 2. Select the BULC option, then select the Movie tool to view the resul
|
|||||||
|
|
||||||
BULC results can be viewed interactively, allowing you to view more detailed estimations of the LULC around the study area. We will zoom into a specific area where change did occur after 2016. To do that, turn on the Satellite view and zoom in. Watching the scale bar in the lower right of the Map panel, continue zooming until the scale bar says 5 km. Then, enter "-60.742, -9.844" in the Earth Engine search tool, located above the code. The text will be interpreted as a longitude/latitude value and will offer you a nearby coordinate, indicated with a value for the degrees West and the degrees South. Click that entry and Earth Engine will move to that location, while keeping at the specified zoom level. Let’s compare the BULC result in this sector against the image from Earth Engine’s satellite view that is underneath it (Fig. 4.8.4).
|
BULC results can be viewed interactively, allowing you to view more detailed estimations of the LULC around the study area. We will zoom into a specific area where change did occur after 2016. To do that, turn on the Satellite view and zoom in. Watching the scale bar in the lower right of the Map panel, continue zooming until the scale bar says 5 km. Then, enter "-60.742, -9.844" in the Earth Engine search tool, located above the code. The text will be interpreted as a longitude/latitude value and will offer you a nearby coordinate, indicated with a value for the degrees West and the degrees South. Click that entry and Earth Engine will move to that location, while keeping at the specified zoom level. Let’s compare the BULC result in this sector against the image from Earth Engine’s satellite view that is underneath it (Fig. 4.8.4).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
BULC captured the changes between 2016 and 2021 with a classification series that suggests agricultural development (Fig. 4.8.4, left). Given the appearance of BULC’s 2021 classification, it suggests that the satellite backdrop at the time of this writing (Fig. 4.8.4, right) came from an earlier time period.
|
BULC captured the changes between 2016 and 2021 with a classification series that suggests agricultural development (Fig. 4.8.4, left). Given the appearance of BULC’s 2021 classification, it suggests that the satellite backdrop at the time of this writing (Fig. 4.8.4, right) came from an earlier time period.
|
||||||
@@ -2542,7 +2542,7 @@ Now, in the Results panel, select BULC, then Movie. Set your desired frame speed
|
|||||||
|
|
||||||
With this finer-scale access to the results of BULC, you can select individual pixels to inspect. Move the horizontal divider downward to expose the Inspector tab and Console tab. Use the Inspector to click on several pixels to learn their history as expressed in the inputted Events and in BULC’s interpretation of the noise and signal in the Event series. In a chosen pixel, you might see output that looks like Fig. 4.8.5. It indicates a possible conversion in the Event time series after a few classifications of the pixel as Forest. This decreases the confidence that the pixel is still Forest (Fig. 4.8.5, lower panel), but not enough for the Active Agriculture class (class 3) to become the dominant probability. After the subsequent Event labels the pixel as Forest, the confidence (lower panel) recovers slightly, but not to its former level. The next Event classifies the pixel as Active Agriculture, confidently, by interpreting that second Active Agriculture classification, in a setting where change was already somewhat suspected after the first non-Forest classification. BULC’s label (middle panel) changes to be Active Agriculture at that point in the sequence. Subsequent Event classifications as Active Agriculture creates a growing confidence that its proper label at the end of the sequence was indeed Active Agriculture.
|
With this finer-scale access to the results of BULC, you can select individual pixels to inspect. Move the horizontal divider downward to expose the Inspector tab and Console tab. Use the Inspector to click on several pixels to learn their history as expressed in the inputted Events and in BULC’s interpretation of the noise and signal in the Event series. In a chosen pixel, you might see output that looks like Fig. 4.8.5. It indicates a possible conversion in the Event time series after a few classifications of the pixel as Forest. This decreases the confidence that the pixel is still Forest (Fig. 4.8.5, lower panel), but not enough for the Active Agriculture class (class 3) to become the dominant probability. After the subsequent Event labels the pixel as Forest, the confidence (lower panel) recovers slightly, but not to its former level. The next Event classifies the pixel as Active Agriculture, confidently, by interpreting that second Active Agriculture classification, in a setting where change was already somewhat suspected after the first non-Forest classification. BULC’s label (middle panel) changes to be Active Agriculture at that point in the sequence. Subsequent Event classifications as Active Agriculture creates a growing confidence that its proper label at the end of the sequence was indeed Active Agriculture.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Question 3. Run the code again with the same data, but adjust the three levelers, then view the results presented in the Map window and the Results panel. How do each of the three parameters affect the behavior of BULC in its results? Use the thumbnail to assess your subjective satisfaction with the results, and use the Inspector to view the BULC behavior in individual pixels. Can you produce an optimal outcome for this given set of input classifications?
|
Question 3. Run the code again with the same data, but adjust the three levelers, then view the results presented in the Map window and the Results panel. How do each of the three parameters affect the behavior of BULC in its results? Use the thumbnail to assess your subjective satisfaction with the results, and use the Inspector to view the BULC behavior in individual pixels. Can you produce an optimal outcome for this given set of input classifications?
|
||||||
@@ -2573,7 +2573,7 @@ After you have run the script to initialize the interface, BULC-D’s interface
|
|||||||
|
|
||||||
Run BULC-D for this area. As a reminder, you should first zoom in enough that the scale bar reads “5 km” or finer. Then, search for the location "-60.7624, -9.8542". When you run BULC-D, a result like Fig. F4.8.6 is shown for the layer of probabilities.
|
Run BULC-D for this area. As a reminder, you should first zoom in enough that the scale bar reads “5 km” or finer. Then, search for the location "-60.7624, -9.8542". When you run BULC-D, a result like Fig. F4.8.6 is shown for the layer of probabilities.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Fig. 4.8.6 Result for BULC-D for the Roosevelt River area, depicting estimated probability of change and stability for 2021
|
Fig. 4.8.6 Result for BULC-D for the Roosevelt River area, depicting estimated probability of change and stability for 2021
|
||||||
|
|
||||||
@@ -2583,7 +2583,7 @@ Each pixel experiences its own NBR history in both the expectation period and th
|
|||||||
|
|
||||||
Figure F4.8.7 shows the NBR history for the red balloon in the southern part of the study area in Fig. F4.8.4. If you click on that pixel or one like it, you can see that, whereas the values were quite stable throughout the growing season for the years used to create the pixel’s expectation, they were persistently lower in the target year. This is flagged as a likely meaningful drop in the NBR by BULC-D, for consideration by the analyst.
|
Figure F4.8.7 shows the NBR history for the red balloon in the southern part of the study area in Fig. F4.8.4. If you click on that pixel or one like it, you can see that, whereas the values were quite stable throughout the growing season for the years used to create the pixel’s expectation, they were persistently lower in the target year. This is flagged as a likely meaningful drop in the NBR by BULC-D, for consideration by the analyst.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Fig. 4.8.7 NBR history for a pixel with an apparent drop in NBR in the target year (below) as compared to the expectation years (above). Pixel is colored a shade of red in Fig. 4.8.6.
|
Fig. 4.8.7 NBR history for a pixel with an apparent drop in NBR in the target year (below) as compared to the expectation years (above). Pixel is colored a shade of red in Fig. 4.8.6.
|
||||||
|
|
||||||
@@ -2591,12 +2591,12 @@ Figure F4.8.8 shows the NBR history for the blue balloon in the southern part of
|
|||||||
|
|
||||||
Question 4. Experiment with turning off one of the satellite sensor data sources used to create the expectation collection. For example, do you get the same results if the Sentinel-2 data stream is not used, or is the outcome different. You might make screen captures of the results to compare with Fig. 4.8.4. How strongly does each satellite stream affect the outcome of the estimate? Do differences in the resulting estimate vary across the study area?
|
Question 4. Experiment with turning off one of the satellite sensor data sources used to create the expectation collection. For example, do you get the same results if the Sentinel-2 data stream is not used, or is the outcome different. You might make screen captures of the results to compare with Fig. 4.8.4. How strongly does each satellite stream affect the outcome of the estimate? Do differences in the resulting estimate vary across the study area?
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Figure F4.8.8 also shows that, for that pixel, the fit of values for the years used to build the expectation showed a sine wave (shown in blue), but with a fit that was not very strong. When data for the target year was assembled (Fig. F4.8.8, bottom), the values were persistently above expectation throughout the growing season. Note that this pixel was identified as being different in the target year as compared to earlier years, which does not rule out the possibility that the LULC of the area was changed (for example, from Forest to Agriculture) during the years used to build the expectation collection. BULC-D is intended to be run steadily over a long period of time, with the changes marked as they occur, after which point the expectation would be recalculated.
|
Figure F4.8.8 also shows that, for that pixel, the fit of values for the years used to build the expectation showed a sine wave (shown in blue), but with a fit that was not very strong. When data for the target year was assembled (Fig. F4.8.8, bottom), the values were persistently above expectation throughout the growing season. Note that this pixel was identified as being different in the target year as compared to earlier years, which does not rule out the possibility that the LULC of the area was changed (for example, from Forest to Agriculture) during the years used to build the expectation collection. BULC-D is intended to be run steadily over a long period of time, with the changes marked as they occur, after which point the expectation would be recalculated.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Fig. F4.8.9 shows the NBR history for the green balloon in the southern part of the study area in Fig. F4.8.4. For that pixel, the values in the expectation collection formed a sine wave, and the values in the target collection deviated only slightly from the expectation during the target year.
|
Fig. F4.8.9 shows the NBR history for the green balloon in the southern part of the study area in Fig. F4.8.4. For that pixel, the values in the expectation collection formed a sine wave, and the values in the target collection deviated only slightly from the expectation during the target year.
|
||||||
@@ -2621,12 +2621,12 @@ Next, BULC will need to know which years of Dynamic World you are interested in.
|
|||||||
|
|
||||||
When you have finished, select Apply Parameters at the bottom of the input panel. When it runs, BULC subsets the Dynamic World dataset to clip out according to the dates and location, identifying images from more than 40 distinct dates. The area covers two of the tiles in which Dynamic World classifications are partitioned to be served, so BULC receives more than 90 classifications. When BULC finishes its run, the Map panel will look like Fig. F4.8.10, BULC’s estimate of the final state of the landscape at the end of the classification sequence.
|
When you have finished, select Apply Parameters at the bottom of the input panel. When it runs, BULC subsets the Dynamic World dataset to clip out according to the dates and location, identifying images from more than 40 distinct dates. The area covers two of the tiles in which Dynamic World classifications are partitioned to be served, so BULC receives more than 90 classifications. When BULC finishes its run, the Map panel will look like Fig. F4.8.10, BULC’s estimate of the final state of the landscape at the end of the classification sequence.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Let’s explore the suite of information returned by BULC about this time period in Dynamic World. Enter “Muiraquitã” in the search bar and view the results around that area to be able to see the changing LULC classifications within farm fields. Then, begin to inspect the results by viewing a Movie of the Events, with a data frame rate of 6 frames per second. Because the study area spans multiple Dynamic World tiles, you will find that many Event frames are black, meaning that there was no data in your sector on that particular image. Because of this, and also perhaps because of the very aggressive cloud masking built into Dynamic World, viewing Events (which, as a reminder, are the individual classified images directly from Dynamic World) can be a very challenging way to look for change and stability. BULC’s goal is to sift through those classifications to produce a time series that reflects, according to its estimation, the most likely LULC value at each time step. View the Movie of the BULC results and ask yourself whether each class is equally well replicated across the set of classifications. A still from midway through the Movie sequence of the BULC results can be seen in Fig. F4.8.11.
|
Let’s explore the suite of information returned by BULC about this time period in Dynamic World. Enter “Muiraquitã” in the search bar and view the results around that area to be able to see the changing LULC classifications within farm fields. Then, begin to inspect the results by viewing a Movie of the Events, with a data frame rate of 6 frames per second. Because the study area spans multiple Dynamic World tiles, you will find that many Event frames are black, meaning that there was no data in your sector on that particular image. Because of this, and also perhaps because of the very aggressive cloud masking built into Dynamic World, viewing Events (which, as a reminder, are the individual classified images directly from Dynamic World) can be a very challenging way to look for change and stability. BULC’s goal is to sift through those classifications to produce a time series that reflects, according to its estimation, the most likely LULC value at each time step. View the Movie of the BULC results and ask yourself whether each class is equally well replicated across the set of classifications. A still from midway through the Movie sequence of the BULC results can be seen in Fig. F4.8.11.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
As BULC uses the classification inputs to estimate the state of the LULC at each time step, it also tracks its confidence in those estimates. This is shown in several ways in the interface.
|
As BULC uses the classification inputs to estimate the state of the LULC at each time step, it also tracks its confidence in those estimates. This is shown in several ways in the interface.
|
||||||
@@ -2636,7 +2636,7 @@ As BULC uses the classification inputs to estimate the state of the LULC at each
|
|||||||
* Another way of viewing BULC’s confidence is through the Inspector tab. You can click on individual pixels to view their values in the Event time series and in the BULC time series, and see BULC’s corresponding confidence value changing through time in response to the relative stability of each pixel’s classification.
|
* Another way of viewing BULC’s confidence is through the Inspector tab. You can click on individual pixels to view their values in the Event time series and in the BULC time series, and see BULC’s corresponding confidence value changing through time in response to the relative stability of each pixel’s classification.
|
||||||
* Another way to view BULC’s confidence estimation is as a hillshade enhancement of the final BULC classification. If you select the Probability Hillshade in the set of Map layers, it shows the final BULC classification as a textured surface, in which you can see where lower-confidence pixels are classified.
|
* Another way to view BULC’s confidence estimation is as a hillshade enhancement of the final BULC classification. If you select the Probability Hillshade in the set of Map layers, it shows the final BULC classification as a textured surface, in which you can see where lower-confidence pixels are classified.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### 5.2. Using BULC To Visualize Uncertainty of Dynamic World in Simplified Categories
|
#### 5.2. Using BULC To Visualize Uncertainty of Dynamic World in Simplified Categories
|
||||||
@@ -2659,7 +2659,7 @@ Before continuing, think for a moment about how many classes you have now. From
|
|||||||
|
|
||||||
The confidence image shown in the main Map panel is instructive (Fig. 4.8.13). Using data from 2020, 2021, and 2022, It indicates that much of the uncertainty among the original Dynamic World classifications was in distinguishing labels within agricultural fields. When that uncertainty is removed by combining classes, the BULC result indicates that a substantial part of the remaining uncertainty is at the edges of distinct covers. For example, in the south-central and southern part of the frame, much of the uncertainty among classifications in the original Dynamic World classifications was due to distinction among the highly similar, easily confused classes. Much of what remained (right) after remapping (right) formed outlines of the river and the edges between farmland and forest: a graphic depiction of the “spatial uncertainty” discussed earlier. Yet not all of the uncertainty was spatial; the thicker, darker areas of uncertainty even after remapping (right, at the extreme eastern edge for example) indicates a more fundamental disagreement in the classifications. In those pixels, even when the Agriculture-like classes were compressed, there was still considerable uncertainty (likely between Forest and Active Agriculture) in the true state of these areas. These might be of further interest: were they places newly deforested in 2020-2022? Were they abandoned fields regrowing? Were they degraded at some point? The mapping of uncertainty may hold promise for a better understanding of uncertainty as it is encountered in real classifications, thanks to Dynamic World.
|
The confidence image shown in the main Map panel is instructive (Fig. 4.8.13). Using data from 2020, 2021, and 2022, It indicates that much of the uncertainty among the original Dynamic World classifications was in distinguishing labels within agricultural fields. When that uncertainty is removed by combining classes, the BULC result indicates that a substantial part of the remaining uncertainty is at the edges of distinct covers. For example, in the south-central and southern part of the frame, much of the uncertainty among classifications in the original Dynamic World classifications was due to distinction among the highly similar, easily confused classes. Much of what remained (right) after remapping (right) formed outlines of the river and the edges between farmland and forest: a graphic depiction of the “spatial uncertainty” discussed earlier. Yet not all of the uncertainty was spatial; the thicker, darker areas of uncertainty even after remapping (right, at the extreme eastern edge for example) indicates a more fundamental disagreement in the classifications. In those pixels, even when the Agriculture-like classes were compressed, there was still considerable uncertainty (likely between Forest and Active Agriculture) in the true state of these areas. These might be of further interest: were they places newly deforested in 2020-2022? Were they abandoned fields regrowing? Were they degraded at some point? The mapping of uncertainty may hold promise for a better understanding of uncertainty as it is encountered in real classifications, thanks to Dynamic World.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Given the tools and approaches presented in this lab, you should now be able to import your own classifications for BULC (Sects. 1–3), detect changes in sets of raw imagery (Sect. 4), or use Dynamic World’s pre-created classifications (Sect. 5). The following exercises explore this potential.
|
Given the tools and approaches presented in this lab, you should now be able to import your own classifications for BULC (Sects. 1–3), detect changes in sets of raw imagery (Sect. 4), or use Dynamic World’s pre-created classifications (Sect. 5). The following exercises explore this potential.
|
||||||
@@ -2922,7 +2922,7 @@ Map.addLayer(covariance17.arrayGet([0, 1]),
|
|||||||
```
|
```
|
||||||
Inspect the pixel values of the resulting covariance image (Fig. F4.9.1). The covariance is positive when the greater values of one variable (at time t) mainly correspond to the greater values of the other variable (at time h), and the same holds for the lesser values, therefore, the values tend to show similar behavior. In the opposite case, when the greater values of a variable correspond to the lesser values of the other variable, the covariance is negative.
|
Inspect the pixel values of the resulting covariance image (Fig. F4.9.1). The covariance is positive when the greater values of one variable (at time t) mainly correspond to the greater values of the other variable (at time h), and the same holds for the lesser values, therefore, the values tend to show similar behavior. In the opposite case, when the greater values of a variable correspond to the lesser values of the other variable, the covariance is negative.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The diagonal elements of the variance-covariance array are variances. Copy and paste the code below to define and map a function to compute correlation (Fig. F4.9.2) from the variance-covariance array.
|
The diagonal elements of the variance-covariance array are variances. Copy and paste the code below to define and map a function to compute correlation (Fig. F4.9.2) from the variance-covariance array.
|
||||||
@@ -2946,7 +2946,7 @@ Map.addLayer(correlation17,
|
|||||||
},
|
},
|
||||||
'correlation (lag = 17 days)');
|
'correlation (lag = 17 days)');
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Higher positive values indicate higher correlation between the elements of the dataset, and lower negative values indicate the opposite.
|
Higher positive values indicate higher correlation between the elements of the dataset, and lower negative values indicate the opposite.
|
||||||
@@ -2985,7 +2985,7 @@ Map.addLayer(corr1PrecipNDVI, {
|
|||||||
```
|
```
|
||||||
What do you observe from this result? Looking at the cross-correlation image (Fig. F4.9.3), do you observe high values where you would expect high NDVI values (vegetated areas)? One possible drawback of this computation is that it's only based on five days of precipitation, whichever five days came right before the NDVI image.
|
What do you observe from this result? Looking at the cross-correlation image (Fig. F4.9.3), do you observe high values where you would expect high NDVI values (vegetated areas)? One possible drawback of this computation is that it's only based on five days of precipitation, whichever five days came right before the NDVI image.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Perhaps precipitation in the month before the observed NDVI is relevant? Copy and paste the code below to test the 30-day lag idea.
|
Perhaps precipitation in the month before the observed NDVI is relevant? Copy and paste the code below to test the 30-day lag idea.
|
||||||
@@ -3017,7 +3017,7 @@ Observe that the only change is to the merge method. Instead of merging the band
|
|||||||
|
|
||||||
Which changes do you notice between the cross-correlation images—5 days lag vs. 30 days lag (Fig. F4.9.4)?. You can use the Inspector tool to assess if the correlation increased or not at vegetated areas.
|
Which changes do you notice between the cross-correlation images—5 days lag vs. 30 days lag (Fig. F4.9.4)?. You can use the Inspector tool to assess if the correlation increased or not at vegetated areas.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
As long as there is sufficient temporal overlap between the time series, these techniques could be extended to longer lags and longer time series.
|
As long as there is sufficient temporal overlap between the time series, these techniques could be extended to longer lags and longer time series.
|
||||||
@@ -3095,7 +3095,7 @@ print(ui.Chart.image.series(
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
At this stage, note that the missing data has become a real problem. Any data point for which at least one of the previous points is masked or missing is also masked.
|
At this stage, note that the missing data has become a real problem. Any data point for which at least one of the previous points is masked or missing is also masked.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ To demonstrate how geometry tools in Earth Engine work, let’s start by creatin
|
|||||||
|
|
||||||
Click on the geometry tools in the top left of the Map pane and create a point feature. Place a new point where USF is located (see Fig. F5.0.1).
|
Click on the geometry tools in the top left of the Map pane and create a point feature. Place a new point where USF is located (see Fig. F5.0.1).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Use Google Maps to search for “Harney Science Center” or “Lo Schiavo Center for Science.” Hover your mouse over the Geometry Imports to find the +new layer menu item and add a new layer to delineate the boundary of a building on campus.
|
Use Google Maps to search for “Harney Science Center” or “Lo Schiavo Center for Science.” Hover your mouse over the Geometry Imports to find the +new layer menu item and add a new layer to delineate the boundary of a building on campus.
|
||||||
@@ -73,7 +73,7 @@ Next, create another new layer to represent the entire campus as a polygon.
|
|||||||
|
|
||||||
After you create these layers, rename the geometry imports at the top of your script. Name the layers usf_point, usf_building, and usf_campus. These names are used within the script shown in Fig. F5.0.2.
|
After you create these layers, rename the geometry imports at the top of your script. Name the layers usf_point, usf_building, and usf_campus. These names are used within the script shown in Fig. F5.0.2.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -103,7 +103,7 @@ There are many image collections loaded in Earth Engine, and they can cover a ve
|
|||||||
|
|
||||||
Use your internet searching skills to locate the “Analysis Neighborhoods” dataset covering San Francisco. This data might be located in a number of places, including DataSF, the City of San Francisco’s public-facing data repository.
|
Use your internet searching skills to locate the “Analysis Neighborhoods” dataset covering San Francisco. This data might be located in a number of places, including DataSF, the City of San Francisco’s public-facing data repository.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
After you find the Analysis Neighborhoods layer, click Export and select Shapefile (Fig. F5.0.3). Keep track of where you save the zipped file, as we will load this into Earth Engine. Shapefiles contain vector-based data—points, lines, polygons—and include a number of files, such as the location information, attribute information, and others.
|
After you find the Analysis Neighborhoods layer, click Export and select Shapefile (Fig. F5.0.3). Keep track of where you save the zipped file, as we will load this into Earth Engine. Shapefiles contain vector-based data—points, lines, polygons—and include a number of files, such as the location information, attribute information, and others.
|
||||||
@@ -114,14 +114,14 @@ Extract the folder to your computer. When you open the folder, you will see that
|
|||||||
|
|
||||||
Navigate to the Assets tab (near Scripts). Select New > Table Upload > Shape files (Fig. F5.0.4).
|
Navigate to the Assets tab (near Scripts). Select New > Table Upload > Shape files (Fig. F5.0.4).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Select Files and Name Asset
|
#### Select Files and Name Asset
|
||||||
|
|
||||||
Click the Select button and then use the file navigator to select the component files of the shapefile structure (i.e., .shp, .dbf, .shx, and .prj) (Fig. F5.0.5). Assign an Asset Name so you can recognize this asset.
|
Click the Select button and then use the file navigator to select the component files of the shapefile structure (i.e., .shp, .dbf, .shx, and .prj) (Fig. F5.0.5). Assign an Asset Name so you can recognize this asset.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Uploading the asset may take a few minutes. The status of the upload is presented under the Tasks tab. After your asset has been successfully loaded, click on the asset in the Assets folder and find the collection ID. Copy this text and use it to import the file into your Earth Engine analysis.
|
Uploading the asset may take a few minutes. The status of the upload is presented under the Tasks tab. After your asset has been successfully loaded, click on the asset in the Assets folder and find the collection ID. Copy this text and use it to import the file into your Earth Engine analysis.
|
||||||
@@ -300,7 +300,7 @@ Export.table.toDrive({
|
|||||||
```
|
```
|
||||||
When you run this code, you will notice that you have the Tasks tab highlighted on the top right of the Earth Engine Code Editor (Fig. F5.0.6). You will be prompted to name the directory when exporting the data.
|
When you run this code, you will notice that you have the Tasks tab highlighted on the top right of the Earth Engine Code Editor (Fig. F5.0.6). You will be prompted to name the directory when exporting the data.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
After you run the task, the file will be saved to your Google Drive. You have now brought a feature into Earth Engine and also exported data from Earth Engine.
|
After you run the task, the file will be saved to your Google Drive. You have now brought a feature into Earth Engine and also exported data from Earth Engine.
|
||||||
@@ -457,13 +457,13 @@ var elevationDrawn = elevationVector.draw({
|
|||||||
Map.addLayer(elevationDrawn, {}, 'Elevation zone polygon');
|
Map.addLayer(elevationDrawn, {}, 'Elevation zone polygon');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
You may have realized that polygons consist of complex lines, including some small polygons with just one pixel. That happens when there are no surrounding pixels of the same elevation zone. You may not need a vector map with such details—if, for instance, you want to produce a regional or global map. We can use a morphological reducer focalMode to simplify the shape by defining a neighborhood size around a pixel. In this example, we will set the kernel radius as four pixels. This operation makes the resulting polygons look much smoother, but less precise (Fig. F5.1.2).
|
You may have realized that polygons consist of complex lines, including some small polygons with just one pixel. That happens when there are no surrounding pixels of the same elevation zone. You may not need a vector map with such details—if, for instance, you want to produce a regional or global map. We can use a morphological reducer focalMode to simplify the shape by defining a neighborhood size around a pixel. In this example, we will set the kernel radius as four pixels. This operation makes the resulting polygons look much smoother, but less precise (Fig. F5.1.2).
|
||||||
@@ -501,18 +501,18 @@ Map.addLayer(smoothDrawn, {}, 'Elevation zone polygon (smooth)');
|
|||||||
|
|
||||||
We can see now that the polygons have more distinct shapes with many fewer small polygons in the new map (Fig. F5.1.2). It is important to note that when you use methods like focalMode (or other, similar methods such as connectedComponents and connectedPixelCount), you need to reproject according to the original image in order to display properly with zoom using the interactive Code Editor.
|
We can see now that the polygons have more distinct shapes with many fewer small polygons in the new map (Fig. F5.1.2). It is important to note that when you use methods like focalMode (or other, similar methods such as connectedComponents and connectedPixelCount), you need to reproject according to the original image in order to display properly with zoom using the interactive Code Editor.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Raster to Points
|
#### Raster to Points
|
||||||
|
|
||||||
Lastly, we will convert a small part of this elevation image into a point vector dataset. For this exercise, we will use the same example and build on the code from the previous subsection. This might be useful when you want to use geospatial data in a tabular format in combination with other conventional datasets such as economic indicators (Fig. F5.1.3).
|
Lastly, we will convert a small part of this elevation image into a point vector dataset. For this exercise, we will use the same example and build on the code from the previous subsection. This might be useful when you want to use geospatial data in a tabular format in combination with other conventional datasets such as economic indicators (Fig. F5.1.3).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The easiest way to do this is to use sample while activating the geometries parameter. This will extract the points at the centroid of the elevation pixel.
|
The easiest way to do this is to use sample while activating the geometries parameter. This will extract the points at the centroid of the elevation pixel.
|
||||||
@@ -571,7 +571,7 @@ Map.addLayer(elevationSamplesStratified, {}, 'Stratified samples');
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -637,7 +637,7 @@ Map.setOptions('SATELLITE');
|
|||||||
```
|
```
|
||||||
This will display the boundary of the La Paya protected area and deforestation in the region (Fig. F5.1.5).
|
This will display the boundary of the La Paya protected area and deforestation in the region (Fig. F5.1.5).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can use Earth Engine to convert the deforestation raster to a set of polygons. The deforestation data are appropriate for this transformation as each deforestation event is labeled categorically by year, and change events are spatially contiguous. This is performed in Earth Engine using the ee.Image.reduceToVectors method, as described earlier in this section.
|
We can use Earth Engine to convert the deforestation raster to a set of polygons. The deforestation data are appropriate for this transformation as each deforestation event is labeled categorically by year, and change events are spatially contiguous. This is performed in Earth Engine using the ee.Image.reduceToVectors method, as described earlier in this section.
|
||||||
@@ -668,9 +668,9 @@ Map.addLayer(deforestationVectorOutline, {
|
|||||||
```
|
```
|
||||||
Fig. F5.1.6 shows a comparison of the raster versus vector representations of deforestation within the protected area.
|
Fig. F5.1.6 shows a comparison of the raster versus vector representations of deforestation within the protected area.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Having converted from raster to vector, a new set of operations becomes available for post-processing the deforestation data. We might, for instance, be interested in the number of individual change events each year (Fig. F5.1.7):
|
Having converted from raster to vector, a new set of operations becomes available for post-processing the deforestation data. We might, for instance, be interested in the number of individual change events each year (Fig. F5.1.7):
|
||||||
@@ -690,7 +690,7 @@ var chart = ui.Chart.feature
|
|||||||
});print(chart);
|
});print(chart);
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
There might also be interest in generating point locations for individual change events (e.g., to aid a field campaign):
|
There might also be interest in generating point locations for individual change events (e.g., to aid a field campaign):
|
||||||
@@ -911,11 +911,11 @@ Map.addLayer(distance.updateMask(protectedAreaRaster.unmask()
|
|||||||
max: 20000}, 'Distance outside protected area');
|
max: 20000}, 'Distance outside protected area');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Sometimes it makes sense to work with objects in raster imagery. This is an unusual case of vector-like operations conducted with raster data. There is a good reason for this where the vector equivalent would be computationally burdensome.
|
Sometimes it makes sense to work with objects in raster imagery. This is an unusual case of vector-like operations conducted with raster data. There is a good reason for this where the vector equivalent would be computationally burdensome.
|
||||||
@@ -950,13 +950,13 @@ Map.addLayer(deforestation5km, {
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Lastly, we can estimate the deforestation area within 1 km of the protected area but only outside of the boundary.
|
Lastly, we can estimate the deforestation area within 1 km of the protected area but only outside of the boundary.
|
||||||
@@ -1254,10 +1254,10 @@ Map.addLayer(ptsTopo, {
|
|||||||
```
|
```
|
||||||
The result is a copy of the buffered point feature collection with new properties added for the region reduction of each selected image band according to the given reducer. A part of the FeatureCollection is shown in Fig. F5.2.1. The data in that FeatureCollection corresponds to a table containing the information of Table F5.2.3. See Fig. F5.2.2 for a graphical representation of the points and the topographic data being summarized.
|
The result is a copy of the buffered point feature collection with new properties added for the region reduction of each selected image band according to the given reducer. A part of the FeatureCollection is shown in Fig. F5.2.1. The data in that FeatureCollection corresponds to a table containing the information of Table F5.2.3. See Fig. F5.2.2 for a graphical representation of the points and the topographic data being summarized.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Table F5.2.3 Example output from zonalStats organized as a table. Rows correspond to collection features and columns are feature properties. Note that elevation and slope values in this table are rounded to the nearest tenth for brevity.
|
Table F5.2.3 Example output from zonalStats organized as a table. Rows correspond to collection features and columns are feature properties. Note that elevation and slope values in this table are rounded to the nearest tenth for brevity.
|
||||||
@@ -1553,7 +1553,7 @@ Map.addLayer(pixelsFc, {
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -1645,7 +1645,7 @@ Map.addLayer(sfBlocks, {
|
|||||||
color: '#de2d26'}, 'Census Blocks (single color)');
|
color: '#de2d26'}, 'Census Blocks (single color)');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The census blocks table has a property named 'pop10' containing the population totals as of the 2010 census. We can use this to create a choropleth map showing population density. We first need to compute the population density for each feature and add it as a property. To add a new property to each feature, we can map a function over the FeatureCollection and calculate the new property called 'pop_density'. Earth Engine provides the area function, which can calculate the area of a feature in square meters. We convert it to square miles and calculate the population density per square mile.
|
The census blocks table has a property named 'pop10' containing the population totals as of the 2010 census. We can use this to create a choropleth map showing population density. We first need to compute the population density for each feature and add it as a property. To add a new property to each feature, we can map a function over the FeatureCollection and calculate the new property called 'pop_density'. Earth Engine provides the area function, which can calculate the area of a feature in square meters. We convert it to square miles and calculate the population density per square mile.
|
||||||
@@ -1685,7 +1685,7 @@ var visParams = {
|
|||||||
Map.addLayer(sfBlocksPaint.clip(geometry), visParams, 'Population Density');
|
Map.addLayer(sfBlocksPaint.clip(geometry), visParams, 'Population Density');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Creating a Categorical Map
|
#### Creating a Categorical Map
|
||||||
@@ -1713,9 +1713,9 @@ var sfRoadsDraw = sfRoads.draw({
|
|||||||
Map.addLayer(sfRoadsDraw, {}, 'Roads (Draw)');
|
Map.addLayer(sfRoadsDraw, {}, 'Roads (Draw)');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The road layer has a column called “MTFCC” (standing for the MAF/TIGER Feature Class Code). This contains the road priority codes, representing the various types of roads, such as primary and secondary. We can use this information to render each road segment according to its priority. The draw function doesn’t allow us to specify different styles for each feature. Instead, we need to make use of the style function.
|
The road layer has a column called “MTFCC” (standing for the MAF/TIGER Feature Class Code). This contains the road priority codes, representing the various types of roads, such as primary and secondary. We can use this information to render each road segment according to its priority. The draw function doesn’t allow us to specify different styles for each feature. Instead, we need to make use of the style function.
|
||||||
@@ -1748,7 +1748,7 @@ var sfRoadsStyle = sfRoads.style({
|
|||||||
Map.addLayer(sfRoadsStyle.clip(geometry), {}, 'Roads (Style)');
|
Map.addLayer(sfRoadsStyle.clip(geometry), {}, 'Roads (Style)');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
@@ -1807,7 +1807,7 @@ var interstateRoadsDrawn = interstateRoads.draw({
|
|||||||
Map.addLayer(interstateRoadsDrawn, {}, 'Interstate Roads');
|
Map.addLayer(interstateRoadsDrawn, {}, 'Interstate Roads');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Let’s define a join that will select all the features from the sfBlocks layer that are within 1 km of any feature from the interstateRoads layer. We start by defining a filter using the ee.Filter.withinDistance filter. We want to compare the geometries of features in both layers, so we use a special property called '.geo' to compare the collections. By default, the filter will work with exact distances between the geometries. If your analysis does not require a very precise tolerance of spatial uncertainty, specifying a small non-zero maxError distance value will help speed up the spatial operations. A larger tolerance also helps when testing or debugging code so you can get the result quickly instead of waiting longer for a more precise output.
|
Let’s define a join that will select all the features from the sfBlocks layer that are within 1 km of any feature from the interstateRoads layer. We start by defining a filter using the ee.Filter.withinDistance filter. We want to compare the geometries of features in both layers, so we use a special property called '.geo' to compare the collections. By default, the filter will work with exact distances between the geometries. If your analysis does not require a very precise tolerance of spatial uncertainty, specifying a small non-zero maxError distance value will help speed up the spatial operations. A larger tolerance also helps when testing or debugging code so you can get the result quickly instead of waiting longer for a more precise output.
|
||||||
@@ -1841,7 +1841,7 @@ var closeBlocksDrawn = closeBlocks.draw({
|
|||||||
Map.addLayer(closeBlocksDrawn, {}, 'Blocks within 1km');
|
Map.addLayer(closeBlocksDrawn, {}, 'Blocks within 1km');
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
#### Spatial Joins
|
#### Spatial Joins
|
||||||
@@ -1874,7 +1874,7 @@ var sfTreesStyled = sfTrees.style({
|
|||||||
Map.addLayer(sfTreesStyled, {}, 'SF Trees');
|
Map.addLayer(sfTreesStyled, {}, 'SF Trees');
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
To find the tree points in each neighborhood polygon, we will use an ee.Filter.intersects filter.
|
To find the tree points in each neighborhood polygon, we will use an ee.Filter.intersects filter.
|
||||||
@@ -1904,7 +1904,7 @@ print(joined.first());
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
You will see that each feature of the sfNeighborhoods collection now has an additional property called trees. This contains all the features from the sfTrees collection that were matched using the intersectFilter. We can now map a function over the results and post-process the collection. As our analysis requires the computation of the total number of trees in each neighborhood, we extract the matching features and use the size function to get the count (Fig. F5.3.9).
|
You will see that each feature of the sfNeighborhoods collection now has an additional property called trees. This contains all the features from the sfTrees collection that were matched using the intersectFilter. We can now map a function over the results and post-process the collection. As our analysis requires the computation of the total number of trees in each neighborhood, we extract the matching features and use the size function to get the count (Fig. F5.3.9).
|
||||||
@@ -1917,7 +1917,7 @@ var sfNeighborhoods = joined.map(function(f) { var treesWithin = ee.List(f.get
|
|||||||
print(sfNeighborhoods.first());
|
print(sfNeighborhoods.first());
|
||||||
|
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The results now have a property called total_trees containing the count of intersecting trees in each neighborhood polygon.
|
The results now have a property called total_trees containing the count of intersecting trees in each neighborhood polygon.
|
||||||
@@ -1938,7 +1938,7 @@ Export.table.toDrive({
|
|||||||
```
|
```
|
||||||
The final result is a CSV file with the neighborhood names and total numbers of trees counted using the join (Fig. F5.3.10).
|
The final result is a CSV file with the neighborhood names and total numbers of trees counted using the join (Fig. F5.3.10).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
:::{.callout-note}
|
:::{.callout-note}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Map.setOptions('HYBRID')
|
|||||||
Map.centerObject(AOI)
|
Map.centerObject(AOI)
|
||||||
Map.addLayer(VIIRS.first(),VIIRSvis,'Nighttime Lights')
|
Map.addLayer(VIIRS.first(),VIIRSvis,'Nighttime Lights')
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
If we decrease the opacity of the VIIRS layer, we can see the cities of Mosul, Erbil and Kirkuk shining brightly at night. We can also see a string of bright lights between Kirkuk and Erbil -- these are methane flares from oil wells.
|
If we decrease the opacity of the VIIRS layer, we can see the cities of Mosul, Erbil and Kirkuk shining brightly at night. We can also see a string of bright lights between Kirkuk and Erbil -- these are methane flares from oil wells.
|
||||||
@@ -180,7 +180,7 @@ The function returns a timelapse of nighttime lights over Northern Iraq:
|
|||||||
``` js
|
``` js
|
||||||
gif(VIIRS, VIIRSvis, AOI);
|
gif(VIIRS, VIIRSvis, AOI);
|
||||||
```
|
```
|
||||||
 and [ezgif](https://ezgif.com/) for the finishing touches. ](../images/Figure_1.gif)
|
 and [ezgif](https://ezgif.com/) for the finishing touches. ](images/Figure_1.gif)
|
||||||
|
|
||||||
|
|
||||||
This timelapse gives a play-by-play of one of the most important campaigns in the war against the Islamic State. In the first few frames, Mosul is under the control of the Kurdistan Regional Government (KRG). In the summer of 2014, ISIS captures the city, and power is cut off. Mosul and many villages along the Tigris river are plunged into darkness. In 2015, the front line in the campaign to retake the city emerges around Mosul, advancing in 2016 and 2017. Mosul is eventually retaken by the KRG in 2017, after which it brightens once again as electricity is restored.
|
This timelapse gives a play-by-play of one of the most important campaigns in the war against the Islamic State. In the first few frames, Mosul is under the control of the Kurdistan Regional Government (KRG). In the summer of 2014, ISIS captures the city, and power is cut off. Mosul and many villages along the Tigris river are plunged into darkness. In 2015, the front line in the campaign to retake the city emerges around Mosul, advancing in 2016 and 2017. Mosul is eventually retaken by the KRG in 2017, after which it brightens once again as electricity is restored.
|
||||||
@@ -240,7 +240,7 @@ var chart =
|
|||||||
|
|
||||||
print(chart)
|
print(chart)
|
||||||
```
|
```
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
We can clearly see Mosul (the red line) darkening in 2014 as the city is taken by ISIS. During this period the Qayyarah oil fields are, as we might expect, quite dark. All of a sudden in 2016 Qayyarah becomes brighter at night than the city of Mosul ever was, as the oilfields are set on fire. Then, almost exactly when the blaze in Qayyarah is extinguished and the area darkens (i.e. when the blue line falls back to near zero), Mosul brightens once again (i.e. the red line rises) as the city is liberated.
|
We can clearly see Mosul (the red line) darkening in 2014 as the city is taken by ISIS. During this period the Qayyarah oil fields are, as we might expect, quite dark. All of a sudden in 2016 Qayyarah becomes brighter at night than the city of Mosul ever was, as the oilfields are set on fire. Then, almost exactly when the blaze in Qayyarah is extinguished and the area darkens (i.e. when the blue line falls back to near zero), Mosul brightens once again (i.e. the red line rises) as the city is liberated.
|
||||||
|
|||||||
@@ -242,13 +242,13 @@ Map.addLayer(
|
|||||||
The visualization parameters correspond to the statistical significance of the change in pixel values. Using the Viridis color palette which ranges from purple to yellow, dark purple pixels indicate no significant change, and yellow pixels indicate a significant change with with 95% confidence. The brighter the yellow of a pixel, the more significant the change.
|
The visualization parameters correspond to the statistical significance of the change in pixel values. Using the Viridis color palette which ranges from purple to yellow, dark purple pixels indicate no significant change, and yellow pixels indicate a significant change with with 95% confidence. The brighter the yellow of a pixel, the more significant the change.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
This seems to be working quite well; but remember, ports are generally prone to change. The t-test is accounting for this by calculating each pixel's variance over the entire time period, but it's still possible that the change we're seeing is due to the port rather than the explosion. To test this, we can run the same algorithm on the same area, using the same date cutoff (August 4th), but in a different year; I've chosen 2018. This is what's known as a placebo test: if it's still showing loads of statistically significant change around the cutoff, our algorithm is probably picking up on port activity rather than the explosion.
|
This seems to be working quite well; but remember, ports are generally prone to change. The t-test is accounting for this by calculating each pixel's variance over the entire time period, but it's still possible that the change we're seeing is due to the port rather than the explosion. To test this, we can run the same algorithm on the same area, using the same date cutoff (August 4th), but in a different year; I've chosen 2018. This is what's known as a placebo test: if it's still showing loads of statistically significant change around the cutoff, our algorithm is probably picking up on port activity rather than the explosion.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Compared to the 2020 image, there's a lot less yellow (significant change). That being said, there are a few yellow areas. This could be due to a number of reasons: ships coming and going, cranes moving, and containers being loaded and unloaded would all register in the change detection algorithm. There are also a number of yellow specks throughout the city, which is also to be expected since cities are also generally in a state of flux. Construction, demolition, and even the growth of vegetation can all be detected by the algorithm.
|
Compared to the 2020 image, there's a lot less yellow (significant change). That being said, there are a few yellow areas. This could be due to a number of reasons: ships coming and going, cranes moving, and containers being loaded and unloaded would all register in the change detection algorithm. There are also a number of yellow specks throughout the city, which is also to be expected since cities are also generally in a state of flux. Construction, demolition, and even the growth of vegetation can all be detected by the algorithm.
|
||||||
@@ -344,19 +344,19 @@ Map.addLayer(
|
|||||||
The result naturally resembles the underlying t-test image, with high levels of damage concentrated around the port, and progressively decreasing damage with distance:
|
The result naturally resembles the underlying t-test image, with high levels of damage concentrated around the port, and progressively decreasing damage with distance:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
To get a better sense of how these predicitions correspond to actual damage, we can zoom in and turn on the Google satellite basemap, which has imagery taken just after the explosion; you can still see capsized boats in the port. Zooming in to the epicenter, we can see several warehouses that were effectively vaporized. Our change detection algorithm picks up on a high degree of change, as indicated by the red outlines of the building footprints:
|
To get a better sense of how these predicitions correspond to actual damage, we can zoom in and turn on the Google satellite basemap, which has imagery taken just after the explosion; you can still see capsized boats in the port. Zooming in to the epicenter, we can see several warehouses that were effectively vaporized. Our change detection algorithm picks up on a high degree of change, as indicated by the red outlines of the building footprints:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
This is pretty low-hanging fruit. Let's look at a different area, around 1.3km east from the epicenter with a mix of warehouses and residential buildings:
|
This is pretty low-hanging fruit. Let's look at a different area, around 1.3km east from the epicenter with a mix of warehouses and residential buildings:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Here, there's greater variation in the predictions. I've highlighted three areas.
|
Here, there's greater variation in the predictions. I've highlighted three areas.
|
||||||
@@ -392,7 +392,7 @@ Below is one of the most viewed videos of the explosion:
|
|||||||
Geolocating this video was pretty simple thanks to the Greek Orthodox church (highlighted in green below) and the road leading to it (highlighted in blue). The red box indicates the likely location (33.889061, 35.515909) from which the person was filming:
|
Geolocating this video was pretty simple thanks to the Greek Orthodox church (highlighted in green below) and the road leading to it (highlighted in blue). The red box indicates the likely location (33.889061, 35.515909) from which the person was filming:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The video shows heavy damage being sustained by areas well outside the zones classified as damaged in the maps above (both my own and NASA's). Indeed, substantial damage was reported several kilometers away.
|
The video shows heavy damage being sustained by areas well outside the zones classified as damaged in the maps above (both my own and NASA's). Indeed, substantial damage was reported several kilometers away.
|
||||||
@@ -401,7 +401,7 @@ The video shows heavy damage being sustained by areas well outside the zones cla
|
|||||||
Why are satellite images underestimating damage in Beirut? Satellite images are taken from above, and are two-dimensional. Much of the damage caused by the blast, however, was directional; the pressure wave hit the sides of buildings, as shown in this diagram from a FEMA manual:
|
Why are satellite images underestimating damage in Beirut? Satellite images are taken from above, and are two-dimensional. Much of the damage caused by the blast, however, was directional; the pressure wave hit the sides of buildings, as shown in this diagram from a FEMA manual:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Areas close to the explosion suffered so much damage that it could be seen from above, but even if an apartment building had all of its windows blown out, this would not necessarily be visible in a top-down view. Even for radar, which does technically collect data in three dimensions, the angle problem remains; a high resolution radar might be able to tell you how tall an apartment complex is, but it won't give you a clear image of all sides. Case in point: the NASA damage map was created using Sentinel-1 SAR data. In a nutshell, damage assessment in this case is a three-dimensional problem, and remote sensing is a two-dimensional solution.
|
Areas close to the explosion suffered so much damage that it could be seen from above, but even if an apartment building had all of its windows blown out, this would not necessarily be visible in a top-down view. Even for radar, which does technically collect data in three dimensions, the angle problem remains; a high resolution radar might be able to tell you how tall an apartment complex is, but it won't give you a clear image of all sides. Case in point: the NASA damage map was created using Sentinel-1 SAR data. In a nutshell, damage assessment in this case is a three-dimensional problem, and remote sensing is a two-dimensional solution.
|
||||||
@@ -419,7 +419,7 @@ To create a more accurate rendering of directional blast damage, three dimension
|
|||||||
Geolocated videos of the blast can be used to verify and adjust the model. Below is a side-by-side comparison of the twitter video and a 3D rendition of OSM data:
|
Geolocated videos of the blast can be used to verify and adjust the model. Below is a side-by-side comparison of the twitter video and a 3D rendition of OSM data:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Some slight adjustments to the raw OSM data were made to achieve the image on the right. The building footprints are generally very accurate and comprehensive in coverage, but the building height data does occasionally have to be adjusted manually. A simple and reliable way of doing this is to look at the shadows cast by the building on the satellite base map and scale accordingly. I also added a rough texture to the buildings to help differentiate them, and added the domed roof of the Greek Orthodox church for reference.
|
Some slight adjustments to the raw OSM data were made to achieve the image on the right. The building footprints are generally very accurate and comprehensive in coverage, but the building height data does occasionally have to be adjusted manually. A simple and reliable way of doing this is to look at the shadows cast by the building on the satellite base map and scale accordingly. I also added a rough texture to the buildings to help differentiate them, and added the domed roof of the Greek Orthodox church for reference.
|
||||||
@@ -434,13 +434,13 @@ For good measure, a second video is geolocated following the same procedure:
|
|||||||
The second pier (highlighted in green) and the angle (in blue) serve as references:
|
The second pier (highlighted in green) and the angle (in blue) serve as references:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The video was taken from the rooftop of a Japanese restaurant called Clap Beirut (in red above). This is confirmed by a picture of the rooftop bar on google images, which matches the bar that can be seen at 0:02 in the twitter video. Below is a comparison of the video view and the 3D OSM model:
|
The video was taken from the rooftop of a Japanese restaurant called Clap Beirut (in red above). This is confirmed by a picture of the rooftop bar on google images, which matches the bar that can be seen at 0:02 in the twitter video. Below is a comparison of the video view and the 3D OSM model:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Though somewhat grainy, the basemap on the OSM rendering shows the same parking lot in the foreground, the second pier, and the same two buildings highlighted in yellow. Having created a 3D model of Beirut using OSM data, we can now simulate how the explosion would interact with the cityscape.
|
Though somewhat grainy, the basemap on the OSM rendering shows the same parking lot in the foreground, the second pier, and the same two buildings highlighted in yellow. Having created a 3D model of Beirut using OSM data, we can now simulate how the explosion would interact with the cityscape.
|
||||||
@@ -455,7 +455,7 @@ Though somewhat grainy, the basemap on the OSM rendering shows the same parking
|
|||||||
As the pressure wave moved through the Beirut, some buildings bore the full force of the explosion, while others were partially shielded by taller structures. A viewshed analysis can be conducted to identify surfaces that were directly exposed to the explosion by creating a lighting object at ground zero; areas that are lit up experienced unobstructed exposure to the blast:
|
As the pressure wave moved through the Beirut, some buildings bore the full force of the explosion, while others were partially shielded by taller structures. A viewshed analysis can be conducted to identify surfaces that were directly exposed to the explosion by creating a lighting object at ground zero; areas that are lit up experienced unobstructed exposure to the blast:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Pressure waves, like sound, are capable of diffraction (bending around small obstructions). To roughly simulate this, the lighting object is gradually raised, allowing the light to pass "around" obstructions. Warehouses on the Eastern side of the docks, as well as the first row of apartment buildings facing the docks are immediately affected. As the lighting object rises above the warehouse, more areas suffer direct exposure.
|
Pressure waves, like sound, are capable of diffraction (bending around small obstructions). To roughly simulate this, the lighting object is gradually raised, allowing the light to pass "around" obstructions. Warehouses on the Eastern side of the docks, as well as the first row of apartment buildings facing the docks are immediately affected. As the lighting object rises above the warehouse, more areas suffer direct exposure.
|
||||||
@@ -464,7 +464,7 @@ Pressure waves, like sound, are capable of diffraction (bending around small obs
|
|||||||
Using two lighting objects-- a red one at 10 meters and a blue one at 20 meters above the warehouse at ground zero-- the intensity of the blast in different areas is highlighted; red areas suffered direct exposure, blue areas suffered partially obstructed exposure, and black areas were indirectly exposed.
|
Using two lighting objects-- a red one at 10 meters and a blue one at 20 meters above the warehouse at ground zero-- the intensity of the blast in different areas is highlighted; red areas suffered direct exposure, blue areas suffered partially obstructed exposure, and black areas were indirectly exposed.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
In the immediate vicinity of the explosion the large "L" shaped building (Lebanon's strategic grain reserve) is bright red, and was barely left standing. It absorbed a large amount of the blast, shielding areas behind it and thereby casting a long blue shadow to the West. If one refers back to the satellite damage maps above, there appears to be significantly less damage in the area just West of ("behind") the grain silo, roughly corresponding to the blue shadow above. While these areas were still heavily damaged, they seem to have suffered less damage than areas of equal distance to the East.
|
In the immediate vicinity of the explosion the large "L" shaped building (Lebanon's strategic grain reserve) is bright red, and was barely left standing. It absorbed a large amount of the blast, shielding areas behind it and thereby casting a long blue shadow to the West. If one refers back to the satellite damage maps above, there appears to be significantly less damage in the area just West of ("behind") the grain silo, roughly corresponding to the blue shadow above. While these areas were still heavily damaged, they seem to have suffered less damage than areas of equal distance to the East.
|
||||||
@@ -482,7 +482,7 @@ The viewshed analysis tells us which sides of a building are exposed to the blas
|
|||||||
To get a more precise idea of the way in which the blast interacted with the urban environment, we can model the blast as an actual wave using the "dynamic wave" feature in Blender. This effectively involves creating a two-dimensional plane, telling it to behave like water, and simulating an object being dropped into the water. By putting an obstruction in this plane, we can see how the wave responds to it. As an example, the grain silo has been isolated below:
|
To get a more precise idea of the way in which the blast interacted with the urban environment, we can model the blast as an actual wave using the "dynamic wave" feature in Blender. This effectively involves creating a two-dimensional plane, telling it to behave like water, and simulating an object being dropped into the water. By putting an obstruction in this plane, we can see how the wave responds to it. As an example, the grain silo has been isolated below:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
As the blast hits the side of the silo, it is reflected. Two large waves can be seen traveling to the right: the initial blast wave, and the reflection from the silo which rivals the initial wave in magnitude. To the left, the wave travels around the silo but is significantly weakened.
|
As the blast hits the side of the silo, it is reflected. Two large waves can be seen traveling to the right: the initial blast wave, and the reflection from the silo which rivals the initial wave in magnitude. To the left, the wave travels around the silo but is significantly weakened.
|
||||||
@@ -491,7 +491,7 @@ As the blast hits the side of the silo, it is reflected. Two large waves can be
|
|||||||
Broadening the focus and adding the rest of the OSM data back in, we can observe how the pressure wave interacted with buildings on the waterfront:
|
Broadening the focus and adding the rest of the OSM data back in, we can observe how the pressure wave interacted with buildings on the waterfront:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The warehouses on the docks were omitted to emphasize the interaction between the pressure wave and the waterfront buildings; their light metal structure and low height means they would have caused little reflection anyway. The general pattern of the dynamic wave is consistent with the viewshed, but adds a layer of detail. The blast is reflected off of the silo towards the East, leading to a double hit. Though the wave still moves around the silo to the West, the pressure is diminished. Once the wave hits the highrises, the pattern becomes noisy as the wave both presses forward into the mainland and is reflected back towards the pier.
|
The warehouses on the docks were omitted to emphasize the interaction between the pressure wave and the waterfront buildings; their light metal structure and low height means they would have caused little reflection anyway. The general pattern of the dynamic wave is consistent with the viewshed, but adds a layer of detail. The blast is reflected off of the silo towards the East, leading to a double hit. Though the wave still moves around the silo to the West, the pressure is diminished. Once the wave hits the highrises, the pattern becomes noisy as the wave both presses forward into the mainland and is reflected back towards the pier.
|
||||||
@@ -519,7 +519,7 @@ For reference, 137 kPa results in 99% fatalities, 68 kPa is enough to cause stru
|
|||||||
Linking the values in this graph to the color of the pressure wave sphere provides a visual representation of the blast's force as it expands. An RGB color scale corresponds to the blast's overpressure at three threshold values.
|
Linking the values in this graph to the color of the pressure wave sphere provides a visual representation of the blast's force as it expands. An RGB color scale corresponds to the blast's overpressure at three threshold values.
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -530,7 +530,7 @@ By keeping the lighting object from the viewshed analysis and placing it within
|
|||||||
Now, referring back to the two geolocated twitter videos from earlier, we can recreate the blast in our 3D model and get some new insights. Below is a side-by-side comparison of the first video and the 3D model:
|
Now, referring back to the two geolocated twitter videos from earlier, we can recreate the blast in our 3D model and get some new insights. Below is a side-by-side comparison of the first video and the 3D model:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Judging by the twitter video alone, it would be very hard to tell the fate of the person filming or the damage caused to the building that they were in. However, the 3D model shows that despite having an unobstructed view of the explosion, the incident pressure of the pressure wave had decreased significantly by the time it reached the viewing point. The blue-green color corresponds to roughly 15 kPa-- enough to injure and break windows, but not enough to cause structural damage to the building.
|
Judging by the twitter video alone, it would be very hard to tell the fate of the person filming or the damage caused to the building that they were in. However, the 3D model shows that despite having an unobstructed view of the explosion, the incident pressure of the pressure wave had decreased significantly by the time it reached the viewing point. The blue-green color corresponds to roughly 15 kPa-- enough to injure and break windows, but not enough to cause structural damage to the building.
|
||||||
@@ -539,7 +539,7 @@ Judging by the twitter video alone, it would be very hard to tell the fate of th
|
|||||||
The second twitter video was taken slightly closer to ground zero, but the view was partially obstructed by the grain silo:
|
The second twitter video was taken slightly closer to ground zero, but the view was partially obstructed by the grain silo:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Though the pressure wave probably exerted more pressure compared to the first angle, the partial obstruction of the grain silo likely tempered the force of the blast.
|
Though the pressure wave probably exerted more pressure compared to the first angle, the partial obstruction of the grain silo likely tempered the force of the blast.
|
||||||
@@ -551,7 +551,7 @@ Though the pressure wave probably exerted more pressure compared to the first an
|
|||||||
As a concrete example of how this approach can be used to assess damage (or predict it, if one had the foresight), let us consider the Skyline Tower, pictured below following the explosion:
|
As a concrete example of how this approach can be used to assess damage (or predict it, if one had the foresight), let us consider the Skyline Tower, pictured below following the explosion:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
This partial side view shows two faces of the building, labeled "A" and "B" above. Side A was nearly perpendicular to the blast, and just 600m from ground zero. Based on the previous modeling, the pressure wave exerted roughly 40 kPa on this side of the building. The corner where sides A and B meet, highlighted in green, shows total destruction of windows, removal of most siding panels, and structural damage. The back corner, highlighted in red, shows many windows still intact, indicating that the maximum overpressure on this side of the building likely didn't exceed 10 kPa. In other words, standing on the front balcony would likely have led to serious injury but standing on the back balcony would have been relatively safe.
|
This partial side view shows two faces of the building, labeled "A" and "B" above. Side A was nearly perpendicular to the blast, and just 600m from ground zero. Based on the previous modeling, the pressure wave exerted roughly 40 kPa on this side of the building. The corner where sides A and B meet, highlighted in green, shows total destruction of windows, removal of most siding panels, and structural damage. The back corner, highlighted in red, shows many windows still intact, indicating that the maximum overpressure on this side of the building likely didn't exceed 10 kPa. In other words, standing on the front balcony would likely have led to serious injury but standing on the back balcony would have been relatively safe.
|
||||||
@@ -560,7 +560,7 @@ This partial side view shows two faces of the building, labeled "A" and "B" abov
|
|||||||
The animation below shows the Skyline Tower as it is hit by the pressure wave, with sides A and B labeled:
|
The animation below shows the Skyline Tower as it is hit by the pressure wave, with sides A and B labeled:
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The bright green color of the pressure wave indicates a strong likelihood of structural damage. Side A can be seen taking a direct hit, while side B is angled slightly away. Despite not being directly exposed to the blast, it likely still took reflective damage from some of the neighboring buildings. Both the incident overpressure indicated by the color of the sphere, as well as the relative brightness of sides A and B both correspond closely to the observed damage taken by the Skyline Tower.
|
The bright green color of the pressure wave indicates a strong likelihood of structural damage. Side A can be seen taking a direct hit, while side B is angled slightly away. Despite not being directly exposed to the blast, it likely still took reflective damage from some of the neighboring buildings. Both the incident overpressure indicated by the color of the sphere, as well as the relative brightness of sides A and B both correspond closely to the observed damage taken by the Skyline Tower.
|
||||||
|
|||||||
@@ -388,7 +388,7 @@ Once you've done this, you can run the following line of code to automatically i
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.10.26) 17 APR 2023 11:17
|
This is XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.10.26) 17 APR 2023 11:43
|
||||||
entering extended mode
|
entering extended mode
|
||||||
restricted \write18 enabled.
|
restricted \write18 enabled.
|
||||||
%&-line parsing enabled.
|
%&-line parsing enabled.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
BIN
docs/.DS_Store
vendored
Normal file
BIN
docs/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 2 Remote Sensing</title>
|
<title>Remote Sensing for OSINT - Remote Sensing</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
span.smallcaps{font-variant: small-caps;}
|
||||||
@@ -167,20 +167,17 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<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 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link active">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -196,26 +193,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -231,32 +224,27 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -271,14 +259,14 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#active-and-passive-sensors" id="toc-active-and-passive-sensors" class="nav-link active" data-scroll-target="#active-and-passive-sensors"><span class="header-section-number">2.1</span> Active and Passive Sensors</a></li>
|
<li><a href="#active-and-passive-sensors" id="toc-active-and-passive-sensors" class="nav-link active" data-scroll-target="#active-and-passive-sensors">Active and Passive Sensors</a></li>
|
||||||
<li><a href="#resolution" id="toc-resolution" class="nav-link" data-scroll-target="#resolution"><span class="header-section-number">2.2</span> Resolution</a>
|
<li><a href="#resolution" id="toc-resolution" class="nav-link" data-scroll-target="#resolution">Resolution</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#spatial-resolution" id="toc-spatial-resolution" class="nav-link" data-scroll-target="#spatial-resolution"><span class="header-section-number">2.2.1</span> Spatial Resolution</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="#spectral-resolution" id="toc-spectral-resolution" class="nav-link" data-scroll-target="#spectral-resolution"><span class="header-section-number">2.2.2</span> Spectral 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="#temporal-resolution" id="toc-temporal-resolution" class="nav-link" data-scroll-target="#temporal-resolution"><span class="header-section-number">2.2.3</span> Temporal Resolution</a></li>
|
<li><a href="#temporal-resolution" id="toc-temporal-resolution" class="nav-link" data-scroll-target="#temporal-resolution">Temporal Resolution</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#summary" id="toc-summary" class="nav-link" data-scroll-target="#summary"><span class="header-section-number">2.3</span> Summary</a></li>
|
<li><a href="#summary" id="toc-summary" class="nav-link" data-scroll-target="#summary">Summary</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/A2_Remote_Sensing.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/A2_Remote_Sensing.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -287,7 +275,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></h1>
|
<h1 class="title"><span class="chapter-title">Remote Sensing</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -303,22 +291,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<p>Before learning how to load, process, and analyze satellite imagery in Google Earth Engine, it will be helpful to know a few basic principles of remote sensing. This section provides a brief overview of some important concepts and terminology that will be used throughout the course, including active and passive sensors; spatial, spectral and temporal resolution; and orbits.</p>
|
<p>Before learning how to load, process, and analyze satellite imagery in Google Earth Engine, it will be helpful to know a few basic principles of remote sensing. This section provides a brief overview of some important concepts and terminology that will be used throughout the course, including active and passive sensors; spatial, spectral and temporal resolution; and orbits.</p>
|
||||||
<section id="active-and-passive-sensors" class="level2" data-number="2.1">
|
<section id="active-and-passive-sensors" class="level2">
|
||||||
<h2 data-number="2.1" class="anchored" data-anchor-id="active-and-passive-sensors"><span class="header-section-number">2.1</span> Active and Passive Sensors</h2>
|
<h2 class="anchored" data-anchor-id="active-and-passive-sensors">Active and Passive Sensors</h2>
|
||||||
<p><a href="https://www.sciencedirect.com/topics/medicine-and-dentistry/remote-sensing">Remote sensing</a> is the science of obtaining information about an object or phenomenon without making physical contact with the object. Remote sensing can be done with various types of electromagnetic radiation such as visible, infrared or microwave. The electromagnetic radiation is either emitted or reflected from the object being sensed. The reflected radiation is then collected by a sensor and processed to obtain information about the object.</p>
|
<p><a href="https://www.sciencedirect.com/topics/medicine-and-dentistry/remote-sensing">Remote sensing</a> is the science of obtaining information about an object or phenomenon without making physical contact with the object. Remote sensing can be done with various types of electromagnetic radiation such as visible, infrared or microwave. The electromagnetic radiation is either emitted or reflected from the object being sensed. The reflected radiation is then collected by a sensor and processed to obtain information about the object.</p>
|
||||||
<p><img src="../images/diagram.png" class="img-fluid"></p>
|
<p><img src="images/diagram.png" class="img-fluid"></p>
|
||||||
<p>While most satellite imagery is optical, meaning it captures sunlight reflected by the earth’s surface, Synthetic Aperture Radar (SAR) satellites such as Sentinel-1 work by emitting pulses of radio waves and measuring how much of the signal is reflected back. This is similar to the way a bat uses sonar to “see” in the dark: by emitting calls and listening to echoes.</p>
|
<p>While most satellite imagery is optical, meaning it captures sunlight reflected by the earth’s surface, Synthetic Aperture Radar (SAR) satellites such as Sentinel-1 work by emitting pulses of radio waves and measuring how much of the signal is reflected back. This is similar to the way a bat uses sonar to “see” in the dark: by emitting calls and listening to echoes.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="resolution" class="level2" data-number="2.2">
|
<section id="resolution" class="level2">
|
||||||
<h2 data-number="2.2" class="anchored" data-anchor-id="resolution"><span class="header-section-number">2.2</span> Resolution</h2>
|
<h2 class="anchored" data-anchor-id="resolution">Resolution</h2>
|
||||||
<p>Resolution is one of the most important attributes of satellite imagery. There are three types of resolution: spatial, spectral, and temporal. Let’s look at each of these.</p>
|
<p>Resolution is one of the most important attributes of satellite imagery. There are three types of resolution: spatial, spectral, and temporal. Let’s look at each of these.</p>
|
||||||
<section id="spatial-resolution" class="level3" data-number="2.2.1">
|
<section id="spatial-resolution" class="level3">
|
||||||
<h3 data-number="2.2.1" class="anchored" data-anchor-id="spatial-resolution"><span class="header-section-number">2.2.1</span> Spatial Resolution</h3>
|
<h3 class="anchored" data-anchor-id="spatial-resolution">Spatial Resolution</h3>
|
||||||
<p>Spatial resolution governs how “sharp” an image looks. The Google Maps satellite basemap, for example, is really sharp. Most of the optical imagery that is freely available has relatively low spatial resolution (it looks more grainy than, for example, the Google satellite basemap),</p>
|
<p>Spatial resolution governs how “sharp” an image looks. The Google Maps satellite basemap, for example, is really sharp. Most of the optical imagery that is freely available has relatively low spatial resolution (it looks more grainy than, for example, the Google satellite basemap),</p>
|
||||||
<p><img src="../images/Landsat.png" class="img-fluid"> <img src="../images/Sentinel2.png" class="img-fluid"> <img src="../images/Maxar.png" class="img-fluid"></p>
|
<p><img src="images/Landsat.png" class="img-fluid"> <img src="images/Sentinel2.png" class="img-fluid"> <img src="images/Maxar.png" class="img-fluid"></p>
|
||||||
</section>
|
</section>
|
||||||
<section id="spectral-resolution" class="level3" data-number="2.2.2">
|
<section id="spectral-resolution" class="level3">
|
||||||
<h3 data-number="2.2.2" class="anchored" data-anchor-id="spectral-resolution"><span class="header-section-number">2.2.2</span> Spectral Resolution</h3>
|
<h3 class="anchored" data-anchor-id="spectral-resolution">Spectral Resolution</h3>
|
||||||
<p>What open access imagery lacks in spatial resolution it often makes up for with <em>spectral</em> resolution. Really sharp imagery from MAXAR, for example, mostly collects light in the visible light spectrum, which is what our eyes can see. But there are other parts of the electromagnetic spectrum that we can’t see, but which can be very useful for distinguishing between different materials. Many satellites that have a lower spatial resolution than MAXAR, such as Landsat and Sentinel-2, collect data in a wider range of the electromagnetic spectrum.</p>
|
<p>What open access imagery lacks in spatial resolution it often makes up for with <em>spectral</em> resolution. Really sharp imagery from MAXAR, for example, mostly collects light in the visible light spectrum, which is what our eyes can see. But there are other parts of the electromagnetic spectrum that we can’t see, but which can be very useful for distinguishing between different materials. Many satellites that have a lower spatial resolution than MAXAR, such as Landsat and Sentinel-2, collect data in a wider range of the electromagnetic spectrum.</p>
|
||||||
<p>Different materials reflect light differently. An apple absorbs shorter wavelengths (e.g. blue and green), and reflects longer wavelengths (red). Our eyes use that information– the color– to distinguish between different objects. Below is a plot of the spectral profiles of different materials:</p>
|
<p>Different materials reflect light differently. An apple absorbs shorter wavelengths (e.g. blue and green), and reflects longer wavelengths (red). Our eyes use that information– the color– to distinguish between different objects. Below is a plot of the spectral profiles of different materials:</p>
|
||||||
<iframe title="Spectral Profiles of Different Materials" aria-label="Interactive line chart" id="datawrapper-chart-b1kcX" src="https://datawrapper.dwcdn.net/b1kcX/3/" scrolling="no" frameborder="0" style="width: 0; min-width: 100% !important; border: none;" height="400">
|
<iframe title="Spectral Profiles of Different Materials" aria-label="Interactive line chart" id="datawrapper-chart-b1kcX" src="https://datawrapper.dwcdn.net/b1kcX/3/" scrolling="no" frameborder="0" style="width: 0; min-width: 100% !important; border: none;" height="400">
|
||||||
@@ -337,8 +325,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>In other words, even though these fields are all green and indistinguishable to the human eye, their <em>spectral profiles</em> beyond the visible light spectrum differ, and we can use this information to distinguish between them.</p>
|
<p>In other words, even though these fields are all green and indistinguishable to the human eye, their <em>spectral profiles</em> beyond the visible light spectrum differ, and we can use this information to distinguish between them.</p>
|
||||||
<p>Astroturf is a trivial example. But suppose we were interested in identifying makeshift oil refineries in Northern Syria that constitute a key source of rents for whichever group controls them. As demonstrated in the <a href="./C2_Refineries.html">‘Refinery Identification’</a> case study, we can train an algorithm to identify the spectral signatures of oil, and use that to automatically detect them in satellite imagery.</p>
|
<p>Astroturf is a trivial example. But suppose we were interested in identifying makeshift oil refineries in Northern Syria that constitute a key source of rents for whichever group controls them. As demonstrated in the <a href="./C2_Refineries.html">‘Refinery Identification’</a> case study, we can train an algorithm to identify the spectral signatures of oil, and use that to automatically detect them in satellite imagery.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="temporal-resolution" class="level3" data-number="2.2.3">
|
<section id="temporal-resolution" class="level3">
|
||||||
<h3 data-number="2.2.3" class="anchored" data-anchor-id="temporal-resolution"><span class="header-section-number">2.2.3</span> Temporal Resolution</h3>
|
<h3 class="anchored" data-anchor-id="temporal-resolution">Temporal Resolution</h3>
|
||||||
<p>Finally, the frequency with which we can access new imagery is an important consideration. This is called the <strong>temporal resolution</strong>.</p>
|
<p>Finally, the frequency with which we can access new imagery is an important consideration. This is called the <strong>temporal resolution</strong>.</p>
|
||||||
<p>The Google Maps basemap is very high resolution, available globally, and is freely available. But it has no <em>temporal</em> dimension: it’s a snapshot from one particular point in time. If the thing we’re interested in involves <em>changes</em> over time, this basemap will be of limited use.</p>
|
<p>The Google Maps basemap is very high resolution, available globally, and is freely available. But it has no <em>temporal</em> dimension: it’s a snapshot from one particular point in time. If the thing we’re interested in involves <em>changes</em> over time, this basemap will be of limited use.</p>
|
||||||
<p>The <strong>“revisit rate”</strong> is the amount of time it takes for the satellite to pass over the same location twice. For example, the Sentinel-2 constellation’s two satellites can achieve a revisit rate of 5 days, as shown in this cool video from the European Space Agency:</p>
|
<p>The <strong>“revisit rate”</strong> is the amount of time it takes for the satellite to pass over the same location twice. For example, the Sentinel-2 constellation’s two satellites can achieve a revisit rate of 5 days, as shown in this cool video from the European Space Agency:</p>
|
||||||
@@ -354,8 +342,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="summary" class="level2" data-number="2.3">
|
<section id="summary" class="level2">
|
||||||
<h2 data-number="2.3" class="anchored" data-anchor-id="summary"><span class="header-section-number">2.3</span> Summary</h2>
|
<h2 class="anchored" data-anchor-id="summary">Summary</h2>
|
||||||
<p>You should hopefully have a better understanding of what satellite imagery is, and how it can be used to answer questions about the world. In the <a href="A3_Data_acquisition.qmd">next section</a>, we’ll look at the various types of satellite imagery stored in the Google Earth Engine catalog.</p>
|
<p>You should hopefully have a better understanding of what satellite imagery is, and how it can be used to answer questions about the world. In the <a href="A3_Data_acquisition.qmd">next section</a>, we’ll look at the various types of satellite imagery stored in the Google Earth Engine catalog.</p>
|
||||||
|
|
||||||
|
|
||||||
@@ -713,12 +701,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./index.html" class="pagination-link">
|
<a href="./index.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Overview</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./A3_Data_Acquisition.html" class="pagination-link">
|
<a href="./A3_Data_Acquisition.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">Data Acquisition</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 3 Data Acquisition</title>
|
<title>Remote Sensing for OSINT - Data Acquisition</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
span.smallcaps{font-variant: small-caps;}
|
||||||
@@ -168,20 +168,17 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<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 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link active">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -197,26 +194,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -232,32 +225,27 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -272,52 +260,52 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#optical-imagery" id="toc-optical-imagery" class="nav-link active" data-scroll-target="#optical-imagery"><span class="header-section-number">3.1</span> Optical Imagery</a>
|
<li><a href="#optical-imagery" id="toc-optical-imagery" class="nav-link active" data-scroll-target="#optical-imagery">Optical Imagery</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications" id="toc-applications" class="nav-link" data-scroll-target="#applications">Applications</a></li>
|
<li><a href="#applications" id="toc-applications" class="nav-link" data-scroll-target="#applications">Applications</a></li>
|
||||||
<li><a href="#datasets" id="toc-datasets" class="nav-link" data-scroll-target="#datasets">Datasets</a></li>
|
<li><a href="#datasets" id="toc-datasets" class="nav-link" data-scroll-target="#datasets">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#radar-imagery" id="toc-radar-imagery" class="nav-link" data-scroll-target="#radar-imagery"><span class="header-section-number">3.2</span> Radar Imagery</a>
|
<li><a href="#radar-imagery" id="toc-radar-imagery" class="nav-link" data-scroll-target="#radar-imagery">Radar Imagery</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-1" id="toc-applications-1" class="nav-link" data-scroll-target="#applications-1">Applications</a></li>
|
<li><a href="#applications-1" id="toc-applications-1" class="nav-link" data-scroll-target="#applications-1">Applications</a></li>
|
||||||
<li><a href="#datasets-1" id="toc-datasets-1" class="nav-link" data-scroll-target="#datasets-1">Datasets</a></li>
|
<li><a href="#datasets-1" id="toc-datasets-1" class="nav-link" data-scroll-target="#datasets-1">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#nighttime-lights" id="toc-nighttime-lights" class="nav-link" data-scroll-target="#nighttime-lights"><span class="header-section-number">3.3</span> Nighttime Lights</a>
|
<li><a href="#nighttime-lights" id="toc-nighttime-lights" class="nav-link" data-scroll-target="#nighttime-lights">Nighttime Lights</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-2" id="toc-applications-2" class="nav-link" data-scroll-target="#applications-2">Applications</a></li>
|
<li><a href="#applications-2" id="toc-applications-2" class="nav-link" data-scroll-target="#applications-2">Applications</a></li>
|
||||||
<li><a href="#datasets-2" id="toc-datasets-2" class="nav-link" data-scroll-target="#datasets-2">Datasets</a></li>
|
<li><a href="#datasets-2" id="toc-datasets-2" class="nav-link" data-scroll-target="#datasets-2">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#climate-and-atmospheric-data" id="toc-climate-and-atmospheric-data" class="nav-link" data-scroll-target="#climate-and-atmospheric-data"><span class="header-section-number">3.4</span> Climate and Atmospheric Data</a>
|
<li><a href="#climate-and-atmospheric-data" id="toc-climate-and-atmospheric-data" class="nav-link" data-scroll-target="#climate-and-atmospheric-data">Climate and Atmospheric Data</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-3" id="toc-applications-3" class="nav-link" data-scroll-target="#applications-3">Applications</a></li>
|
<li><a href="#applications-3" id="toc-applications-3" class="nav-link" data-scroll-target="#applications-3">Applications</a></li>
|
||||||
<li><a href="#datasets-3" id="toc-datasets-3" class="nav-link" data-scroll-target="#datasets-3">Datasets</a></li>
|
<li><a href="#datasets-3" id="toc-datasets-3" class="nav-link" data-scroll-target="#datasets-3">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#mineral-deposits" id="toc-mineral-deposits" class="nav-link" data-scroll-target="#mineral-deposits"><span class="header-section-number">3.5</span> Mineral Deposits</a>
|
<li><a href="#mineral-deposits" id="toc-mineral-deposits" class="nav-link" data-scroll-target="#mineral-deposits">Mineral Deposits</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-4" id="toc-applications-4" class="nav-link" data-scroll-target="#applications-4">Applications</a></li>
|
<li><a href="#applications-4" id="toc-applications-4" class="nav-link" data-scroll-target="#applications-4">Applications</a></li>
|
||||||
<li><a href="#datasets-4" id="toc-datasets-4" class="nav-link" data-scroll-target="#datasets-4">Datasets</a></li>
|
<li><a href="#datasets-4" id="toc-datasets-4" class="nav-link" data-scroll-target="#datasets-4">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#fires" id="toc-fires" class="nav-link" data-scroll-target="#fires"><span class="header-section-number">3.6</span> Fires</a>
|
<li><a href="#fires" id="toc-fires" class="nav-link" data-scroll-target="#fires">Fires</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-5" id="toc-applications-5" class="nav-link" data-scroll-target="#applications-5">Applications</a></li>
|
<li><a href="#applications-5" id="toc-applications-5" class="nav-link" data-scroll-target="#applications-5">Applications</a></li>
|
||||||
<li><a href="#datasets-5" id="toc-datasets-5" class="nav-link" data-scroll-target="#datasets-5">Datasets</a></li>
|
<li><a href="#datasets-5" id="toc-datasets-5" class="nav-link" data-scroll-target="#datasets-5">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#population-density-estimates" id="toc-population-density-estimates" class="nav-link" data-scroll-target="#population-density-estimates"><span class="header-section-number">3.7</span> Population Density Estimates</a>
|
<li><a href="#population-density-estimates" id="toc-population-density-estimates" class="nav-link" data-scroll-target="#population-density-estimates">Population Density Estimates</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-6" id="toc-applications-6" class="nav-link" data-scroll-target="#applications-6">Applications:</a></li>
|
<li><a href="#applications-6" id="toc-applications-6" class="nav-link" data-scroll-target="#applications-6">Applications:</a></li>
|
||||||
<li><a href="#datasets-6" id="toc-datasets-6" class="nav-link" data-scroll-target="#datasets-6">Datasets</a></li>
|
<li><a href="#datasets-6" id="toc-datasets-6" class="nav-link" data-scroll-target="#datasets-6">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#building-footprints" id="toc-building-footprints" class="nav-link" data-scroll-target="#building-footprints"><span class="header-section-number">3.8</span> Building Footprints</a>
|
<li><a href="#building-footprints" id="toc-building-footprints" class="nav-link" data-scroll-target="#building-footprints">Building Footprints</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-7" id="toc-applications-7" class="nav-link" data-scroll-target="#applications-7">Applications:</a></li>
|
<li><a href="#applications-7" id="toc-applications-7" class="nav-link" data-scroll-target="#applications-7">Applications:</a></li>
|
||||||
<li><a href="#datasets-7" id="toc-datasets-7" class="nav-link" data-scroll-target="#datasets-7">Datasets</a></li>
|
<li><a href="#datasets-7" id="toc-datasets-7" class="nav-link" data-scroll-target="#datasets-7">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#administrative-boundaries" id="toc-administrative-boundaries" class="nav-link" data-scroll-target="#administrative-boundaries"><span class="header-section-number">3.9</span> Administrative Boundaries</a>
|
<li><a href="#administrative-boundaries" id="toc-administrative-boundaries" class="nav-link" data-scroll-target="#administrative-boundaries">Administrative Boundaries</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-8" id="toc-applications-8" class="nav-link" data-scroll-target="#applications-8">Applications</a></li>
|
<li><a href="#applications-8" id="toc-applications-8" class="nav-link" data-scroll-target="#applications-8">Applications</a></li>
|
||||||
<li><a href="#datasets-8" id="toc-datasets-8" class="nav-link" data-scroll-target="#datasets-8">Datasets</a></li>
|
<li><a href="#datasets-8" id="toc-datasets-8" class="nav-link" data-scroll-target="#datasets-8">Datasets</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#global-power-plant-database" id="toc-global-power-plant-database" class="nav-link" data-scroll-target="#global-power-plant-database"><span class="header-section-number">3.10</span> Global Power Plant Database</a>
|
<li><a href="#global-power-plant-database" id="toc-global-power-plant-database" class="nav-link" data-scroll-target="#global-power-plant-database">Global Power Plant Database</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#applications-9" id="toc-applications-9" class="nav-link" data-scroll-target="#applications-9">Applications:</a></li>
|
<li><a href="#applications-9" id="toc-applications-9" class="nav-link" data-scroll-target="#applications-9">Applications:</a></li>
|
||||||
<li><a href="#datasets-9" id="toc-datasets-9" class="nav-link" data-scroll-target="#datasets-9">Datasets</a></li>
|
<li><a href="#datasets-9" id="toc-datasets-9" class="nav-link" data-scroll-target="#datasets-9">Datasets</a></li>
|
||||||
@@ -330,7 +318,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></h1>
|
<h1 class="title"><span class="chapter-title">Data Acquisition</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -347,11 +335,11 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<p>One of the main advantages of GEE is that it hosts several Petabytes of satellite imagery and other spatial data sets, <a href="https://developers.google.com/earth-engine/datasets">all in one place</a>. Among these are many that could prove useful to those investigating illegal mining and logging, estimating conflict-induced damage, monitoring pollution from extractive industries, conducting maritime surveillance without relying on ship transponders, verifying the locations of artillery strikes, tracking missile defense systems and many other topics.</p>
|
<p>One of the main advantages of GEE is that it hosts several Petabytes of satellite imagery and other spatial data sets, <a href="https://developers.google.com/earth-engine/datasets">all in one place</a>. Among these are many that could prove useful to those investigating illegal mining and logging, estimating conflict-induced damage, monitoring pollution from extractive industries, conducting maritime surveillance without relying on ship transponders, verifying the locations of artillery strikes, tracking missile defense systems and many other topics.</p>
|
||||||
<p>This section highlights ten categories of geospatial data available natively in the GEE catalog, ranging from optical satellite imagery, to atmospheric data, to building footprints. Each sub-section provides an overview of the given data type, suggests potential applications, and lists the corresponding datasets in the GEE catalog. The datasets listed under each heading are <strong>not</strong> an exhaustive list– there are over 500 in the whole catalog, and the ones listed in this section are simply the ones with the most immediate relevance to open source investigations. If a particular geospatial dataset you want to work with isn’t hosted in the GEE catalog, you can upload your own data. We’ll cover that in the next section.</p>
|
<p>This section highlights ten categories of geospatial data available natively in the GEE catalog, ranging from optical satellite imagery, to atmospheric data, to building footprints. Each sub-section provides an overview of the given data type, suggests potential applications, and lists the corresponding datasets in the GEE catalog. The datasets listed under each heading are <strong>not</strong> an exhaustive list– there are over 500 in the whole catalog, and the ones listed in this section are simply the ones with the most immediate relevance to open source investigations. If a particular geospatial dataset you want to work with isn’t hosted in the GEE catalog, you can upload your own data. We’ll cover that in the next section.</p>
|
||||||
<section id="optical-imagery" class="level2" data-number="3.1">
|
<section id="optical-imagery" class="level2">
|
||||||
<h2 data-number="3.1" class="anchored" data-anchor-id="optical-imagery"><span class="header-section-number">3.1</span> Optical Imagery</h2>
|
<h2 class="anchored" data-anchor-id="optical-imagery">Optical Imagery</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/obj_det3.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/obj_det3.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Automatic detection of vehicles using artificial intelligence in high resolution optical imagery. See the <a href="./C5_Object_Detection.html">object detection</a> tutorial.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Automatic detection of vehicles using artificial intelligence in high resolution optical imagery. See the <a href="./C5_Object_Detection.html">object detection</a> tutorial.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -472,11 +460,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="radar-imagery" class="level2" data-number="3.2">
|
<section id="radar-imagery" class="level2">
|
||||||
<h2 data-number="3.2" class="anchored" data-anchor-id="radar-imagery"><span class="header-section-number">3.2</span> Radar Imagery</h2>
|
<h2 class="anchored" data-anchor-id="radar-imagery">Radar Imagery</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/radar ships.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/radar ships.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Ships and interference from a radar system are visible in Zhuanghe Wan, near North Korea.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Ships and interference from a radar system are visible in Zhuanghe Wan, near North Korea.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -512,11 +500,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="nighttime-lights" class="level2" data-number="3.3">
|
<section id="nighttime-lights" class="level2">
|
||||||
<h2 data-number="3.3" class="anchored" data-anchor-id="nighttime-lights"><span class="header-section-number">3.3</span> Nighttime Lights</h2>
|
<h2 class="anchored" data-anchor-id="nighttime-lights">Nighttime Lights</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/Figure_1.gif" class="img-fluid figure-img"></p>
|
<p><img src="images/Figure_1.gif" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">A timelapse of nighttime lights over Northern Iraq showing the capture and liberation of Mosul by ISIS.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">A timelapse of nighttime lights over Northern Iraq showing the capture and liberation of Mosul by ISIS.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -558,11 +546,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="climate-and-atmospheric-data" class="level2" data-number="3.4">
|
<section id="climate-and-atmospheric-data" class="level2">
|
||||||
<h2 data-number="3.4" class="anchored" data-anchor-id="climate-and-atmospheric-data"><span class="header-section-number">3.4</span> Climate and Atmospheric Data</h2>
|
<h2 class="anchored" data-anchor-id="climate-and-atmospheric-data">Climate and Atmospheric Data</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/mishraq_small.gif" class="img-fluid figure-img" style="width:100.0%"></p>
|
<p><img src="images/mishraq_small.gif" class="img-fluid figure-img" style="width:100.0%"></p>
|
||||||
<p></p><figcaption class="figure-caption">Sulphur Dioxide plume resulting from ISIS attack on the Al-Mishraq Sulphur Plant in Iraq</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Sulphur Dioxide plume resulting from ISIS attack on the Al-Mishraq Sulphur Plant in Iraq</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -608,11 +596,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="mineral-deposits" class="level2" data-number="3.5">
|
<section id="mineral-deposits" class="level2">
|
||||||
<h2 data-number="3.5" class="anchored" data-anchor-id="mineral-deposits"><span class="header-section-number">3.5</span> Mineral Deposits</h2>
|
<h2 class="anchored" data-anchor-id="mineral-deposits">Mineral Deposits</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/mining.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/mining.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Zinc deposits across Central Africa</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Zinc deposits across Central Africa</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -647,11 +635,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="fires" class="level2" data-number="3.6">
|
<section id="fires" class="level2">
|
||||||
<h2 data-number="3.6" class="anchored" data-anchor-id="fires"><span class="header-section-number">3.6</span> Fires</h2>
|
<h2 class="anchored" data-anchor-id="fires">Fires</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/fires.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/fires.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Detected fires over Ukraine since 27/02/2022 showing the frontline of the war</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Detected fires over Ukraine since 27/02/2022 showing the frontline of the war</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -696,11 +684,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="population-density-estimates" class="level2" data-number="3.7">
|
<section id="population-density-estimates" class="level2">
|
||||||
<h2 data-number="3.7" class="anchored" data-anchor-id="population-density-estimates"><span class="header-section-number">3.7</span> Population Density Estimates</h2>
|
<h2 class="anchored" data-anchor-id="population-density-estimates">Population Density Estimates</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/pop.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/pop.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Population density estimates around Pyongyang, North Korea</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Population density estimates around Pyongyang, North Korea</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -745,11 +733,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="building-footprints" class="level2" data-number="3.8">
|
<section id="building-footprints" class="level2">
|
||||||
<h2 data-number="3.8" class="anchored" data-anchor-id="building-footprints"><span class="header-section-number">3.8</span> Building Footprints</h2>
|
<h2 class="anchored" data-anchor-id="building-footprints">Building Footprints</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/footprints.png" class="img-fluid figure-img"></p>
|
<p><img src="images/footprints.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Building footprints in Mariupol, Ukraine colored by whether the building is damaged</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Building footprints in Mariupol, Ukraine colored by whether the building is damaged</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -780,11 +768,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="administrative-boundaries" class="level2" data-number="3.9">
|
<section id="administrative-boundaries" class="level2">
|
||||||
<h2 data-number="3.9" class="anchored" data-anchor-id="administrative-boundaries"><span class="header-section-number">3.9</span> Administrative Boundaries</h2>
|
<h2 class="anchored" data-anchor-id="administrative-boundaries">Administrative Boundaries</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/fao_gaul.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/fao_gaul.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Second-level administrative boundaries in Yemen</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Second-level administrative boundaries in Yemen</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -818,11 +806,11 @@ C-->H
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="global-power-plant-database" class="level2" data-number="3.10">
|
<section id="global-power-plant-database" class="level2">
|
||||||
<h2 data-number="3.10" class="anchored" data-anchor-id="global-power-plant-database"><span class="header-section-number">3.10</span> Global Power Plant Database</h2>
|
<h2 class="anchored" data-anchor-id="global-power-plant-database">Global Power Plant Database</h2>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/power.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/power.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Power plants in Ukraine colored by type</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Power plants in Ukraine colored by type</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1212,12 +1200,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./A2_Remote_Sensing.html" class="pagination-link">
|
<a href="./A2_Remote_Sensing.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Remote Sensing</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./B1_Getting_Started.html" class="pagination-link">
|
<a href="./B1_Getting_Started.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">Getting Started</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ This section highlights ten categories of geospatial data available natively in
|
|||||||
|
|
||||||
|
|
||||||
## Optical Imagery
|
## Optical Imagery
|
||||||
 tutorial.](../images/obj_det3.jpg)
|
 tutorial.](images/obj_det3.jpg)
|
||||||
|
|
||||||
|
|
||||||
Optical satellite imagery is the bread and butter of many open source investigations. It would be tough to list off all of the possible use cases, so here's a handy flowchart:
|
Optical satellite imagery is the bread and butter of many open source investigations. It would be tough to list off all of the possible use cases, so here's a handy flowchart:
|
||||||
@@ -83,7 +83,7 @@ There are several different types of optical satellite imagery available in the
|
|||||||
|
|
||||||
|
|
||||||
## Radar Imagery
|
## Radar Imagery
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses radio waves to detect objects on the ground. SAR imagery is useful for detecting objects that are small, or that are obscured by clouds or other weather phenomena. SAR imagery is also useful for detecting objects that are moving, such as ships or cars.
|
Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses radio waves to detect objects on the ground. SAR imagery is useful for detecting objects that are small, or that are obscured by clouds or other weather phenomena. SAR imagery is also useful for detecting objects that are moving, such as ships or cars.
|
||||||
@@ -109,7 +109,7 @@ Synthetic Aperture Radar imagery (SAR) is a type of remote sensing that uses rad
|
|||||||
|
|
||||||
|
|
||||||
## Nighttime Lights
|
## Nighttime Lights
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Satellite images of the Earth at night are a useful proxy for human activity. The brightness of a given area at night is a function of the number of people living there and the nature of their activities. The effects of conflict, natural disasters, and economic development can all be inferred from changes in nighttime lights.
|
Satellite images of the Earth at night are a useful proxy for human activity. The brightness of a given area at night is a function of the number of people living there and the nature of their activities. The effects of conflict, natural disasters, and economic development can all be inferred from changes in nighttime lights.
|
||||||
@@ -144,7 +144,7 @@ The timelapse above reveals a number of interesting things: The capture of Mosul
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
{width=100%}
|
{width=100%}
|
||||||
|
|
||||||
|
|
||||||
Climate and atmospheric data can be used to track the effects of conflict on the environment. The European Space Agency's Sentinel-5p satellites measure the concentration of a number of atmospheric gasses, including nitrogen dioxide, methane and ozone. Measurements are available on a daily basis at a fairly high resolution (1km), allowing for the detection of localized sources of pollution such as oil refineries or power plants. For example, see this [Bellingcat article](https://www.bellingcat.com/resources/2021/04/15/what-oil-satellite-technology-and-iraq-can-tell-us-about-pollution/) in which Wim Zwijnenburg and I trace pollution to specific facilities operated by multinational oil companies in Iraq.
|
Climate and atmospheric data can be used to track the effects of conflict on the environment. The European Space Agency's Sentinel-5p satellites measure the concentration of a number of atmospheric gasses, including nitrogen dioxide, methane and ozone. Measurements are available on a daily basis at a fairly high resolution (1km), allowing for the detection of localized sources of pollution such as oil refineries or power plants. For example, see this [Bellingcat article](https://www.bellingcat.com/resources/2021/04/15/what-oil-satellite-technology-and-iraq-can-tell-us-about-pollution/) in which Wim Zwijnenburg and I trace pollution to specific facilities operated by multinational oil companies in Iraq.
|
||||||
@@ -175,7 +175,7 @@ The Copernicus Atmosphere Monitoring Service (CAMS) provides similar data at a l
|
|||||||
|
|
||||||
|
|
||||||
## Mineral Deposits
|
## Mineral Deposits
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Mining activities often play an important role in conflict. According to an influential [study](https://www.aeaweb.org/articles?id=10.1257/aer.20150774), "the historical rise in mineral prices might explain up to one-fourth of the average level of violence across African countries" between 1997 and 2010. Data on the location of mineral deposits can be used to identify areas where mining activities are likely to be taking place, and several such datasets are available in Google Earth Engine.
|
Mining activities often play an important role in conflict. According to an influential [study](https://www.aeaweb.org/articles?id=10.1257/aer.20150774), "the historical rise in mineral prices might explain up to one-fourth of the average level of violence across African countries" between 1997 and 2010. Data on the location of mineral deposits can be used to identify areas where mining activities are likely to be taking place, and several such datasets are available in Google Earth Engine.
|
||||||
@@ -204,7 +204,7 @@ Mining activities often play an important role in conflict. According to an infl
|
|||||||
|
|
||||||
|
|
||||||
## Fires
|
## Fires
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Earth-observing satellites can detect "thermal anomalies" (fires) from space. NASA's Fire Information for Resource Management System (FIRMS) provides daily data on active fires in near real time, going back to the year 2000. Carlos Gonzales wrote a comprehensive [Bellingcat article](https://www.bellingcat.com/resources/2022/10/04/scorched-earth-using-nasa-fire-data-to-monitor-war-zones/) on the use of FIRMS to monitor war zones from Ukraine to Ethiopia. The map above shows that FIRMS detected fires over Eastern Ukraine trace the frontline of the war.
|
Earth-observing satellites can detect "thermal anomalies" (fires) from space. NASA's Fire Information for Resource Management System (FIRMS) provides daily data on active fires in near real time, going back to the year 2000. Carlos Gonzales wrote a comprehensive [Bellingcat article](https://www.bellingcat.com/resources/2022/10/04/scorched-earth-using-nasa-fire-data-to-monitor-war-zones/) on the use of FIRMS to monitor war zones from Ukraine to Ethiopia. The map above shows that FIRMS detected fires over Eastern Ukraine trace the frontline of the war.
|
||||||
@@ -234,7 +234,7 @@ FIRMS data are derived from the MODIS satellite, but only show the central locat
|
|||||||
|
|
||||||
|
|
||||||
## Population Density Estimates
|
## Population Density Estimates
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Sometimes, we may want to get an estimate of the population in a specific area to ballpark how many people might be affected by a natural disaster, a counteroffensive or a missile strike. You can't really Google "what is the population in this rectangle I've drawn in Northeastern Syria?" and get a good answer. Luckily, there are several spatial population datasets hosted in GEE that let you do just that. Some, such as WorldPop, provide estimated breakdowns by age and sex as well. However, it is extremely important to bear in mind that these are **estimates**, and will **not** take into account things like conflict-induced displacement. For example, Oak Ridge National Laboratory's LandScan program has released high-resolution population data for Ukraine, but this pertains to the pre-war population distribution. The war has radically changed this distribution, so these estimates no longer reflect where people *are*. Still, this dataset could be used to roughly estimate displacement or the number of people who will need new housing.
|
Sometimes, we may want to get an estimate of the population in a specific area to ballpark how many people might be affected by a natural disaster, a counteroffensive or a missile strike. You can't really Google "what is the population in this rectangle I've drawn in Northeastern Syria?" and get a good answer. Luckily, there are several spatial population datasets hosted in GEE that let you do just that. Some, such as WorldPop, provide estimated breakdowns by age and sex as well. However, it is extremely important to bear in mind that these are **estimates**, and will **not** take into account things like conflict-induced displacement. For example, Oak Ridge National Laboratory's LandScan program has released high-resolution population data for Ukraine, but this pertains to the pre-war population distribution. The war has radically changed this distribution, so these estimates no longer reflect where people *are*. Still, this dataset could be used to roughly estimate displacement or the number of people who will need new housing.
|
||||||
@@ -261,7 +261,7 @@ Sometimes, we may want to get an estimate of the population in a specific area t
|
|||||||
|
|
||||||
|
|
||||||
## Building Footprints
|
## Building Footprints
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
A building footprint dataset contains the two dimensional outlines of buildings in a given area. Currently, GEE hosts one building footprint dataset which covers all of Africa. In 2022, Microsoft released a free [global building footprint dataset](https://www.microsoft.com/en-us/maps/building-footprints), though to use it in Earth Engine you'll have to download it from their [GitHub page](https://github.com/Microsoft/USBuildingFootprints) and upload it manually to GEE. The same goes for OpenStreetMap (OSM), a public database of building footprints, roads, and other features that also contains useful annotations for many buildings indicating their use. [Benjamin Strick](https://www.youtube.com/watch?v=bJkV3l5Haq0) has a great youtube video on conducting investigations using OSM data.
|
A building footprint dataset contains the two dimensional outlines of buildings in a given area. Currently, GEE hosts one building footprint dataset which covers all of Africa. In 2022, Microsoft released a free [global building footprint dataset](https://www.microsoft.com/en-us/maps/building-footprints), though to use it in Earth Engine you'll have to download it from their [GitHub page](https://github.com/Microsoft/USBuildingFootprints) and upload it manually to GEE. The same goes for OpenStreetMap (OSM), a public database of building footprints, roads, and other features that also contains useful annotations for many buildings indicating their use. [Benjamin Strick](https://www.youtube.com/watch?v=bJkV3l5Haq0) has a great youtube video on conducting investigations using OSM data.
|
||||||
@@ -284,7 +284,7 @@ A building footprint dataset contains the two dimensional outlines of buildings
|
|||||||
|
|
||||||
|
|
||||||
## Administrative Boundaries
|
## Administrative Boundaries
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
Spatial analysis often has to aggregate information over a defined area; we may want to assess the total burned area by province in Ukraine, or count the number of Saudi airstrikes by district in Yemen. For that, we need data on these administrative boundaries. GEE hosts several such datasets at the country, province, and district (or equivalent) level.
|
Spatial analysis often has to aggregate information over a defined area; we may want to assess the total burned area by province in Ukraine, or count the number of Saudi airstrikes by district in Yemen. For that, we need data on these administrative boundaries. GEE hosts several such datasets at the country, province, and district (or equivalent) level.
|
||||||
@@ -308,7 +308,7 @@ Spatial analysis often has to aggregate information over a defined area; we may
|
|||||||
|
|
||||||
|
|
||||||
## Global Power Plant Database
|
## Global Power Plant Database
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
The Global Power Plant Database is a comprehensive, open source database of power plants around the world. It centralizes power plant data to make it easier to navigate, compare and draw insights. Each power plant is geolocated and entries contain information on plant capacity, generation, ownership, and fuel type. As of June 2018, the database includes around 28,500 power plants from 164 countries. The database is curated by the [World Resources Institute (WRI)](https://datasets.wri.org/dataset/globalpowerplantdatabase).
|
The Global Power Plant Database is a comprehensive, open source database of power plants around the world. It centralizes power plant data to make it easier to navigate, compare and draw insights. Each power plant is geolocated and entries contain information on plant capacity, generation, ownership, and fuel type. As of June 2018, the database includes around 28,500 power plants from 164 countries. The database is curated by the [World Resources Institute (WRI)](https://datasets.wri.org/dataset/globalpowerplantdatabase).
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 4 Getting Started</title>
|
<title>Remote Sensing for OSINT - Getting Started</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
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 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link active">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 ">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -303,44 +291,44 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<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">
|
<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="#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"><span class="header-section-number">4.1.2</span> JavaScript Basics</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"><span class="header-section-number">4.1.3</span> Earth Engine API 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>
|
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
||||||
</ul></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">
|
<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="#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"><span class="header-section-number">4.2.2</span> Visualizing 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"><span class="header-section-number">4.2.3</span> True-Color Composites</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"><span class="header-section-number">4.2.4</span> False-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"><span class="header-section-number">4.2.5</span> Attributes of Locations</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"><span class="header-section-number">4.2.6</span> Abstract RGB Composites</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>
|
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
|
||||||
</ul></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">
|
<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="#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"><span class="header-section-number">4.3.2</span> View an Image Collection</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"><span class="header-section-number">4.3.3</span> Filtering Image Collections</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"><span class="header-section-number">4.3.4</span> Collections of Single Images</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"><span class="header-section-number">4.3.5</span> MODIS Monthly Burned Areas</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"><span class="header-section-number">4.3.6</span> Methane</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"><span class="header-section-number">4.3.7</span> Global Forest Change</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"><span class="header-section-number">4.3.8</span> Digital Elevation Models</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="#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>
|
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
|
||||||
</ul></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">
|
<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="#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"><span class="header-section-number">4.4.2</span> Spatial Resolution</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"><span class="header-section-number">4.4.3</span> Temporal 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"><span class="header-section-number">4.4.4</span> Spectral 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"><span class="header-section-number">4.4.5</span> Per-Pixel Quality</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"><span class="header-section-number">4.4.6</span> Metadata</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="#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>
|
<li><a href="#references-1" id="toc-references-1" class="nav-link" data-scroll-target="#references-1">References</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
@@ -352,7 +340,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></h1>
|
<h1 class="title"><span class="chapter-title">Getting Started</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -367,8 +355,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section id="programming-basics" class="level2" data-number="4.1">
|
<section id="programming-basics" class="level2">
|
||||||
<h2 data-number="4.1" class="anchored" data-anchor-id="programming-basics"><span class="header-section-number">4.1</span> Programming Basics</h2>
|
<h2 class="anchored" data-anchor-id="programming-basics">Programming Basics</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<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>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>
|
<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>
|
||||||
<section id="getting-started-in-the-code-editor" class="level3" data-number="4.1.1">
|
<section id="getting-started-in-the-code-editor" class="level3">
|
||||||
<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>
|
<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 book’s 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&sa=D&source=editors&ust=1670414092101269&usg=AOvVaw2sJyDO_fhq1tcjG77pri7V"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092101852&usg=AOvVaw088kfXu4o_Mp4b8DJBPYjH">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1670414092102526&usg=AOvVaw3ZCmkCOjrZEWqxfjRZPOCn">this link</a> for help.</p>
|
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1670414092101269&usg=AOvVaw2sJyDO_fhq1tcjG77pri7V"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092101852&usg=AOvVaw088kfXu4o_Mp4b8DJBPYjH">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1670414092102526&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 Google’s 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>
|
<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 Google’s 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.1 The Earth Engine Code Editor</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.2 Typing and running code</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.3 Saving a script</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.4 Creating a home folder</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.5 Creating a new repository</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.6 Saving a file</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.7 The script manager</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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>
|
||||||
<section id="javascript-basics" class="level3" data-number="4.1.2">
|
<section id="javascript-basics" class="level3">
|
||||||
<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>
|
<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>
|
<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">
|
<section id="variables" class="level4 unnumbered">
|
||||||
<h4 class="unnumbered anchored" data-anchor-id="variables">Variables</h4>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.8 A JavaScript list</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.9 A JavaScript object</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.10 JavaScript function output</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="comments" class="level4 unnumbbered" data-number="4.1.2.1">
|
<section id="comments" class="level4 unnumbbered">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="earth-engine-api-basics" class="level3" data-number="4.1.3">
|
<section id="earth-engine-api-basics" class="level3">
|
||||||
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.12 Earth Engine API docs</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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. That’s what you use to add a and b.</p>
|
<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. That’s what you use to add a and b.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.13 ee.Number module</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -576,7 +564,7 @@ print(result);</p>
|
|||||||
<p>Here’s another example to drive this point home. Let’s 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>
|
<p>Here’s another example to drive this point home. Let’s 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.14 The ee.List.sequence function</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.0.15 Output of ee.List.sequence function</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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>
|
</section>
|
||||||
<section id="exploring-images" class="level2" data-number="4.2">
|
<section id="exploring-images" class="level2">
|
||||||
<h2 data-number="4.2" class="anchored" data-anchor-id="exploring-images"><span class="header-section-number">4.2</span> Exploring Images</h2>
|
<h2 class="anchored" data-anchor-id="exploring-images">Exploring Images</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -648,8 +636,8 @@ Chapter Information
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section id="accessing-an-image" class="level3" data-number="4.2.1">
|
<section id="accessing-an-image" class="level3">
|
||||||
<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>
|
<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 book’s 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&sa=D&source=editors&ust=1670414092189999&usg=AOvVaw1jWHeBmeq93I_lo_9useCA"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092190705&usg=AOvVaw3Z7cK8r6eOSYUceNjA8oUg">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1670414092191415&usg=AOvVaw2eETuRpR5worezkj7citx6">this link</a> for help.</p>
|
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1670414092189999&usg=AOvVaw1jWHeBmeq93I_lo_9useCA"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1670414092190705&usg=AOvVaw3Z7cK8r6eOSYUceNjA8oUg">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1670414092191415&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>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>
|
<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 let’s 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>
|
<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 let’s 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.1 Image metadata printed to Console panel</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>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>
|
<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>
|
||||||
<section id="visualizing-an-image" class="level3" data-number="4.2.2">
|
<section id="visualizing-an-image" class="level3">
|
||||||
<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>
|
<h3 class="anchored" data-anchor-id="visualizing-an-image">Visualizing an Image</h3>
|
||||||
<p>Now let’s add one of the bands to the map as a layer so that we can see it.</p>
|
<p>Now let’s 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>
|
<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>
|
<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>Let’s 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>
|
<p>Let’s 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.2 Image data reported through the Inspector panel</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -740,8 +728,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="true-color-composites" class="level3" data-number="4.2.3">
|
<section id="true-color-composites" class="level3">
|
||||||
<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>
|
<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>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 pixel’s values across three bands.</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 pixel’s values across three bands.</p>
|
||||||
<p>To try this, add this code and run it.</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.4 True-color composite</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="false-color-composites" class="level3" data-number="4.2.4">
|
<section id="false-color-composites" class="level3">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.5 Color-infrared image (a false-color composite)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.7 Shortwave infrared false-color composite</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.8 Near-infrared versus shortwave infrared false-color composites</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -817,8 +805,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="attributes-of-locations" class="level3" data-number="4.2.5">
|
<section id="attributes-of-locations" class="level3">
|
||||||
<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>
|
<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>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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.10 Stable nighttime lights in 1993</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="abstract-rgb-composites" class="level3" data-number="4.2.6">
|
<section id="abstract-rgb-composites" class="level3">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.11 RGB composite of stable nighttime lights (2013, 2003, 1993)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.1.13 Nighttime light changes in the Middle East</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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>
|
</section>
|
||||||
<section id="survey-of-raster-datasets" class="level2" data-number="4.3">
|
<section id="survey-of-raster-datasets" class="level2">
|
||||||
<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>
|
<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>
|
<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 callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
@@ -944,13 +932,13 @@ Chapter Information
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section id="image-collections-an-organized-set-of-images" class="level3" data-number="4.3.1">
|
<section id="image-collections-an-organized-set-of-images" class="level3">
|
||||||
<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>
|
<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>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>
|
<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>
|
||||||
<section id="view-an-image-collection" class="level3" data-number="4.3.2">
|
<section id="view-an-image-collection" class="level3">
|
||||||
<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>
|
<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 Earth’s surface. We will now view images and basic information about one of the image collections that is still growing: collections of scenes taken by the Operational Land Imager aboard Landsat 8, which was launched in 2013. Copy and paste the following code into the center panel and click Run. While the enormous image catalog is accessed, it could take a couple of minutes to see the result in the Map area. If it takes more than a couple of minutes to see the images, try zooming in to a specific area to speed up the process.</p>
|
<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 Earth’s surface. We will now view images and basic information about one of the image collections that is still growing: collections of scenes taken by the Operational Land Imager aboard Landsat 8, which was launched in 2013. Copy and paste the following code into the center panel and click Run. While the enormous image catalog is accessed, it could take a couple of minutes to see the result in the Map area. If it takes more than a couple of minutes to see the images, try zooming in to a specific area to speed up the process.</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>
|
<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>
|
<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, let’s examine the map output (Fig. F1.2.1).</p>
|
<p>First, let’s examine the map output (Fig. F1.2.1).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.1 USGS Landsat 8 Collection 2 Tier 1 Raw Scenes collection</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</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 don’t want to see a million image names printed to the Console!</p>
|
<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 don’t want to see a million image names printed to the Console!</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1015,11 +1003,11 @@ Note
|
|||||||
</div>
|
</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>
|
<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>
|
||||||
<section id="filtering-image-collections" class="level3" data-number="4.3.3">
|
<section id="filtering-image-collections" class="level3">
|
||||||
<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>
|
<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>
|
<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">
|
<section id="filter-by-date" class="level4">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.4 Landsat 8 Winter Collection</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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 2020–2021.</p>
|
<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 2020–2021.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="filter-by-location" class="level4" data-number="4.3.3.2">
|
<section id="filter-by-location" class="level4">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.5 Minneapolis Winter Collection filtered by bounds.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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>
|
||||||
<section id="selecting-the-first-image" class="level4" data-number="4.3.3.3">
|
<section id="selecting-the-first-image" class="level4">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.6 First Landsat image from the filtered set</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1111,8 +1099,8 @@ Note
|
|||||||
<p>Now that we have the tools to examine different image collections, we will explore other datasets.</p>
|
<p>Now that we have the tools to examine different image collections, we will explore other datasets.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="collections-of-single-images" class="level3" data-number="4.3.4">
|
<section id="collections-of-single-images" class="level3">
|
||||||
<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>
|
<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>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 Earth’s surface and the satellite. The view from satellites is made imprecise by the need for light rays to pass through the atmosphere, even on the clearest day. There are two important ways the atmosphere obscures a satellite’s view: by affecting the amount of sunlight that strikes the Earth, and by altering electromagnetic energy on its trip from its reflection at Earth’s surface to the satellite’s receptors.</p>
|
<p>Among the most prominent of these is the ImageCollection meant to minimize the effect of the atmosphere between Earth’s surface and the satellite. The view from satellites is made imprecise by the need for light rays to pass through the atmosphere, even on the clearest day. There are two important ways the atmosphere obscures a satellite’s view: by affecting the amount of sunlight that strikes the Earth, and by altering electromagnetic energy on its trip from its reflection at Earth’s surface to the satellite’s receptors.</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 Earth’s surface to downward radiance at the Earth’s surface, imitating what the sensor would have seen if it were hovering a few feet above the ground.</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 Earth’s surface to downward radiance at the Earth’s surface, imitating what the sensor would have seen if it were hovering a few feet above the ground.</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.7 Landsat 8 Surface Reflectance image bands and date</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.8 Landsat 8 Surface Reflectance scene from March 18, 2014</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1170,8 +1158,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="modis-monthly-burned-areas" class="level3" data-number="4.3.5">
|
<section id="modis-monthly-burned-areas" class="level3">
|
||||||
<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>
|
<h3 class="anchored" data-anchor-id="modis-monthly-burned-areas">MODIS Monthly Burned Areas</h3>
|
||||||
<p>We’ll 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>We’ll 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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.11. MODIS Monthly Burn image over California</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1204,8 +1192,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
<p>Save your script and start a new one by refreshing the page.</p>
|
<p>Save your script and start a new one by refreshing the page.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="methane" class="level3" data-number="4.3.6">
|
<section id="methane" class="level3">
|
||||||
<h3 data-number="4.3.6" class="anchored" data-anchor-id="methane"><span class="header-section-number">4.3.6</span> Methane</h3>
|
<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. Let’s take a closer look at a few of these datasets.</p>
|
<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. Let’s 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>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>
|
<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>
|
<p>Notice the different levels of methane over the African continent (Fig. F1.2.12).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.12. Methane levels over the African continent on November 28, 2018</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="global-forest-change" class="level3" data-number="4.3.7">
|
<section id="global-forest-change" class="level3">
|
||||||
<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>
|
<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 Earth’s surface in a base year of 2000, and how that has changed over time. Copy and paste the code below to visualize the tree cover in 2000. Note that in the code below we define the visualization parameters as a variable treeCoverViz instead of having its calculation done within the Map.addLayer function.</p>
|
<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 Earth’s surface in a base year of 2000, and how that has changed over time. Copy and paste the code below to visualize the tree cover in 2000. Note that in the code below we define the visualization parameters as a variable treeCoverViz instead of having its calculation done within the Map.addLayer function.</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>
|
<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>
|
<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,” don’t worry. Sometimes Earth Engine will show these transient errors, but they won’t affect the script in any way.</p>
|
<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,” don’t worry. Sometimes Earth Engine will show these transient errors, but they won’t affect the script in any way.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.15 Global Forest Change 2000 tree cover layer</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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 2000–2020 tree cover loss (yellow-red) and 2000 tree cover (black-green)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F1.2.16 Global Forest Change 2000–2020 tree cover loss (yellow-red) and 2000 tree cover (black-green)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1297,8 +1285,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
<p>Save your script and start a new one.</p>
|
<p>Save your script and start a new one.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="digital-elevation-models" class="level3" data-number="4.3.8">
|
<section id="digital-elevation-models" class="level3">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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-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>
|
<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>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>
|
<p>Fig. F1.2.18. NASADEM elevation</p>
|
||||||
<div class="callout callout-style-default callout-note callout-titled">
|
<div class="callout callout-style-default callout-note callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<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:1–23. https://doi.org/10.3390/rs13010010</p>
|
<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:1–23. https://doi.org/10.3390/rs13010010</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="the-remote-sensing-vocabulary" class="level2" data-number="4.4">
|
<section id="the-remote-sensing-vocabulary" class="level2">
|
||||||
<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>
|
<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 callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -1377,19 +1365,19 @@ Chapter Information
|
|||||||
<h3 class="unlisted unnumbered anchored" data-anchor-id="introduction-1">Introduction</h3>
|
<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>
|
<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>
|
||||||
<section id="searching-for-and-viewing-image-collection-information" class="level3" data-number="4.4.1">
|
<section id="searching-for-and-viewing-image-collection-information" class="level3">
|
||||||
<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>
|
<h3 class="anchored" data-anchor-id="searching-for-and-viewing-image-collection-information">Searching for and Viewing Image Collection Information</h3>
|
||||||
<p>Earth Engine’s search bar can be used to find imagery and to locate important information about datasets in Earth Engine. Let’s 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>
|
<p>Earth Engine’s search bar can be used to find imagery and to locate important information about datasets in Earth Engine. Let’s 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.1 Searching for Landsat 7 in the search bar</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.2 Inset window with information about the Landsat 7 dataset</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.4 Search results matching “landsat 7 collection 2”</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Now that we know how to view this information, let’s dive into some important remote sensing terminology.</p>
|
<p>Now that we know how to view this information, let’s dive into some important remote sensing terminology.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="spatial-resolution" class="level3" data-number="4.4.2">
|
<section id="spatial-resolution" class="level3">
|
||||||
<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>
|
<h3 class="anchored" data-anchor-id="spatial-resolution">Spatial Resolution</h3>
|
||||||
<p>Spatial resolution relates to the amount of Earth’s 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 Earth’s 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 Earth’s surface.</p>
|
<p>Spatial resolution relates to the amount of Earth’s 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 Earth’s 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 Earth’s 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. We’ll 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>
|
<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. We’ll 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">
|
<section id="landsat-thematic-mapper" class="level4">
|
||||||
<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>
|
<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). Let’s 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>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). Let’s 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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.10 Visualizing the TM imagery from the Landsat 5 satellite</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="sentinel-2-multispectral-instrument" class="level4" data-number="4.4.2.2">
|
<section id="sentinel-2-multispectral-instrument" class="level4">
|
||||||
<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>
|
<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>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>
|
<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>
|
<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 Earth’s surface, a much smaller area than the TM imagery (900 m2).</p>
|
<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 Earth’s surface, a much smaller area than the TM imagery (900 m2).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.11 Visualizing the MSI imagery</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="national-agriculture-imagery-program-naip" class="level4" data-number="4.4.2.3">
|
<section id="national-agriculture-imagery-program-naip" class="level4">
|
||||||
<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>
|
<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.5–2 m, depending on the state and the date collected.</p>
|
<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.5–2 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>
|
<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>
|
<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 doesn’t 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>
|
<p>The NAIP imagery is even more spatially detailed than the Sentinel-2 MSI imagery. However, we can see that our one NAIP image doesn’t 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.13 NAIP color-IR composite over the San Francisco airport</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1503,11 +1491,11 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="temporal-resolution" class="level3" data-number="4.4.3">
|
<section id="temporal-resolution" class="level3">
|
||||||
<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>
|
<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 sensor’s image stream. Revisit time is the number of days between sequential visits of the satellite to the same location on the Earth’s surface. Think of this as the frequency of pixels in a time series at a given location.</p>
|
<p>Temporal resolution refers to the revisit time, or temporal cadence of a particular sensor’s image stream. Revisit time is the number of days between sequential visits of the satellite to the same location on the Earth’s 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">
|
<section id="landsat" class="level4">
|
||||||
<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>
|
<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. Let’s 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>
|
<p>The Landsat satellites 5 and later are able to image a given location every 16 days. Let’s 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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.14 Landsat image name and feature properties</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="sentinel-2" class="level4" data-number="4.4.3.2">
|
<section id="sentinel-2" class="level4">
|
||||||
<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>
|
<h4 class="anchored" data-anchor-id="sentinel-2">Sentinel-2</h4>
|
||||||
<p>The Sentinel-2 program’s 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. Let’s create a chart using the MSI instrument dataset we have already imported.</p>
|
<p>The Sentinel-2 program’s 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. Let’s 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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1595,12 +1583,12 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="spectral-resolution" class="level3" data-number="4.4.4">
|
<section id="spectral-resolution" class="level3">
|
||||||
<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>
|
<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 3–10 bands), while a sensor with many bands (possibly hundreds) is called a hyperspectral sensor.</p>
|
<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 3–10 bands), while a sensor with many bands (possibly hundreds) is called a hyperspectral sensor.</p>
|
||||||
<p>Let’s compare the multispectral MODIS instrument with the hyperspectral Hyperion sensor aboard the EO-1 satellite, which is also available in Earth Engine.</p>
|
<p>Let’s 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">
|
<section id="modis" class="level4">
|
||||||
<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>
|
<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>
|
<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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.17 Plot of TOA reflectance for MODIS</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="eo-1" class="level4" data-number="4.4.4.2">
|
<section id="eo-1" class="level4">
|
||||||
<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>
|
<h4 class="anchored" data-anchor-id="eo-1">EO-1</h4>
|
||||||
<p>Now let’s compare MODIS with the EO-1 satellite’s 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>
|
<p>Now let’s compare MODIS with the EO-1 satellite’s 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>
|
<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>
|
<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>
|
<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<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>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>If we click on the expand icon in the top right corner of the chart, it’s a little easier to see the band identifiers, as shown in Fig. F1.3.19.</p>
|
<p>If we click on the expand icon in the top right corner of the chart, it’s a little easier to see the band identifiers, as shown in Fig. F1.3.19.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<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>
|
<p></p><figcaption class="figure-caption">Fig. F1.3.19 Expanded plot of TOA reflectance for EO-1</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1713,8 +1701,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="per-pixel-quality" class="level3" data-number="4.4.5">
|
<section id="per-pixel-quality" class="level3">
|
||||||
<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>
|
<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 Earth’s 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>As you saw above, an image consists of many bands. Some of these bands contain spectral responses of Earth’s 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. Let’s map it to inspect the values.</p>
|
<p>For example, Sentinel-2 has a QA60 band, which contains the surface reflectance quality assurance information. Let’s 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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="metadata" class="level3" data-number="4.4.6">
|
<section id="metadata" class="level3">
|
||||||
<h3 data-number="4.4.6" class="anchored" data-anchor-id="metadata"><span class="header-section-number">4.4.6</span> Metadata</h3>
|
<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>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>Let’s examine the metadata for the Sentinel-2 MSI.</p>
|
<p>Let’s 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>
|
<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-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>
|
<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 you’ve created in the Console (Fig. F1.3.20). Expand the image name, then the properties object.</p>
|
<p>Examine the object you’ve 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>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 image’s properties using the get function, and printed to the Console.</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 image’s 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>
|
<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">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./A3_Data_Acquisition.html" class="pagination-link">
|
<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> <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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./B2_Interpreting_Images.html" class="pagination-link">
|
<a href="./B2_Interpreting_Images.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">5</span> <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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 5 Interpreting Images</title>
|
<title>Remote Sensing for OSINT - Interpreting Images</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
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 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link active">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 ">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -303,24 +291,24 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#image-manipulation-bands-arithmetic-thresholds-and-masks" id="toc-image-manipulation-bands-arithmetic-thresholds-and-masks" class="nav-link active" data-scroll-target="#image-manipulation-bands-arithmetic-thresholds-and-masks"><span class="header-section-number">5.1</span> Image Manipulation: Bands, Arithmetic, Thresholds, and Masks</a>
|
<li><a href="#image-manipulation-bands-arithmetic-thresholds-and-masks" id="toc-image-manipulation-bands-arithmetic-thresholds-and-masks" class="nav-link active" data-scroll-target="#image-manipulation-bands-arithmetic-thresholds-and-masks">Image Manipulation: Bands, Arithmetic, Thresholds, and Masks</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#band-arithmetic-in-earth-engine" id="toc-band-arithmetic-in-earth-engine" class="nav-link" data-scroll-target="#band-arithmetic-in-earth-engine"><span class="header-section-number">5.1.1</span> Band Arithmetic in Earth Engine</a></li>
|
<li><a href="#band-arithmetic-in-earth-engine" id="toc-band-arithmetic-in-earth-engine" class="nav-link" data-scroll-target="#band-arithmetic-in-earth-engine">Band Arithmetic in Earth Engine</a></li>
|
||||||
<li><a href="#thresholding-masking-and-remapping-images" id="toc-thresholding-masking-and-remapping-images" class="nav-link" data-scroll-target="#thresholding-masking-and-remapping-images"><span class="header-section-number">5.1.2</span> Thresholding, Masking, and Remapping Images</a></li>
|
<li><a href="#thresholding-masking-and-remapping-images" id="toc-thresholding-masking-and-remapping-images" class="nav-link" data-scroll-target="#thresholding-masking-and-remapping-images">Thresholding, Masking, and Remapping Images</a></li>
|
||||||
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
||||||
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
|
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#interpreting-an-image-classification" id="toc-interpreting-an-image-classification" class="nav-link" data-scroll-target="#interpreting-an-image-classification"><span class="header-section-number">5.2</span> Interpreting an Image: Classification</a>
|
<li><a href="#interpreting-an-image-classification" id="toc-interpreting-an-image-classification" class="nav-link" data-scroll-target="#interpreting-an-image-classification">Interpreting an Image: Classification</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#supervised-classification" id="toc-supervised-classification" class="nav-link" data-scroll-target="#supervised-classification"><span class="header-section-number">5.2.1</span> Supervised Classification</a></li>
|
<li><a href="#supervised-classification" id="toc-supervised-classification" class="nav-link" data-scroll-target="#supervised-classification">Supervised Classification</a></li>
|
||||||
<li><a href="#unsupervised-classification" id="toc-unsupervised-classification" class="nav-link" data-scroll-target="#unsupervised-classification"><span class="header-section-number">5.2.2</span> Unsupervised Classification</a></li>
|
<li><a href="#unsupervised-classification" id="toc-unsupervised-classification" class="nav-link" data-scroll-target="#unsupervised-classification">Unsupervised Classification</a></li>
|
||||||
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
|
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
|
||||||
<li><a href="#references-1" id="toc-references-1" class="nav-link" data-scroll-target="#references-1">References</a></li>
|
<li><a href="#references-1" id="toc-references-1" class="nav-link" data-scroll-target="#references-1">References</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#accuracy-assessment-quantifying-classification-quality" id="toc-accuracy-assessment-quantifying-classification-quality" class="nav-link" data-scroll-target="#accuracy-assessment-quantifying-classification-quality"><span class="header-section-number">5.3</span> Accuracy Assessment: Quantifying Classification Quality</a>
|
<li><a href="#accuracy-assessment-quantifying-classification-quality" id="toc-accuracy-assessment-quantifying-classification-quality" class="nav-link" data-scroll-target="#accuracy-assessment-quantifying-classification-quality">Accuracy Assessment: Quantifying Classification Quality</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#quantifying-classification-accuracy-through-a-confusion-matrix" id="toc-quantifying-classification-accuracy-through-a-confusion-matrix" class="nav-link" data-scroll-target="#quantifying-classification-accuracy-through-a-confusion-matrix"><span class="header-section-number">5.3.1</span> Quantifying Classification Accuracy Through a Confusion Matrix</a></li>
|
<li><a href="#quantifying-classification-accuracy-through-a-confusion-matrix" id="toc-quantifying-classification-accuracy-through-a-confusion-matrix" class="nav-link" data-scroll-target="#quantifying-classification-accuracy-through-a-confusion-matrix">Quantifying Classification Accuracy Through a Confusion Matrix</a></li>
|
||||||
<li><a href="#hyperparameter-tuning" id="toc-hyperparameter-tuning" class="nav-link" data-scroll-target="#hyperparameter-tuning"><span class="header-section-number">5.3.2</span> Hyperparameter tuning</a></li>
|
<li><a href="#hyperparameter-tuning" id="toc-hyperparameter-tuning" class="nav-link" data-scroll-target="#hyperparameter-tuning">Hyperparameter tuning</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="#conclusion-2" id="toc-conclusion-2" class="nav-link" data-scroll-target="#conclusion-2">Conclusion</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -331,7 +319,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></h1>
|
<h1 class="title"><span class="chapter-title">Interpreting Images</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -347,8 +335,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<p>Now that you know how images are viewed and what kinds of images exist in Earth Engine, how do we manipulate them? To gain the skills of interpreting images, you’ll work with bands, combining values to form indices and masking unwanted pixels. Then, you’ll learn some of the techniques available in Earth Engine for classifying images and interpreting the results.</p>
|
<p>Now that you know how images are viewed and what kinds of images exist in Earth Engine, how do we manipulate them? To gain the skills of interpreting images, you’ll work with bands, combining values to form indices and masking unwanted pixels. Then, you’ll learn some of the techniques available in Earth Engine for classifying images and interpreting the results.</p>
|
||||||
<section id="image-manipulation-bands-arithmetic-thresholds-and-masks" class="level2" data-number="5.1">
|
<section id="image-manipulation-bands-arithmetic-thresholds-and-masks" class="level2">
|
||||||
<h2 data-number="5.1" class="anchored" data-anchor-id="image-manipulation-bands-arithmetic-thresholds-and-masks"><span class="header-section-number">5.1</span> Image Manipulation: Bands, Arithmetic, Thresholds, and Masks</h2>
|
<h2 class="anchored" data-anchor-id="image-manipulation-bands-arithmetic-thresholds-and-masks">Image Manipulation: Bands, Arithmetic, Thresholds, and Masks</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -387,29 +375,29 @@ Chapter Information
|
|||||||
<p>Spectral indices are based on the fact that different objects and land covers on the Earth’s surface reflect different amounts of light from the Sun at different wavelengths. In the visible part of the spectrum, for example, a healthy green plant reflects a large amount of green light while absorbing blue and red light — which is why it appears green to our eyes. Light also arrives from the Sun at wavelengths outside what the human eye can see, and there are large differences in reflectances between living and nonliving land covers, and between different types of vegetation, both in the visible and outside the visible wavelengths. We visualized this earlier, in Chaps. F1.1 and F1.3 when we mapped color-infrared images (Fig. F2.0.1).</p>
|
<p>Spectral indices are based on the fact that different objects and land covers on the Earth’s surface reflect different amounts of light from the Sun at different wavelengths. In the visible part of the spectrum, for example, a healthy green plant reflects a large amount of green light while absorbing blue and red light — which is why it appears green to our eyes. Light also arrives from the Sun at wavelengths outside what the human eye can see, and there are large differences in reflectances between living and nonliving land covers, and between different types of vegetation, both in the visible and outside the visible wavelengths. We visualized this earlier, in Chaps. F1.1 and F1.3 when we mapped color-infrared images (Fig. F2.0.1).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image39.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image39.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.1 Mapped color-IR images from multiple satellite sensors that we mapped in Chap. F1.3. The near infrared spectrum is mapped as red, showing where there are high amounts of healthy vegetation.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.1 Mapped color-IR images from multiple satellite sensors that we mapped in Chap. F1.3. The near infrared spectrum is mapped as red, showing where there are high amounts of healthy vegetation.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>If we graph the amount of light (reflectance) at different wavelengths that an object or land cover reflects, we can visualize this more easily (Fig. F2.0.2). For example, look at the reflectance curves for soil and water in the graph below. Soil and water both have relatively low reflectance at wavelengths around 300 nm (ultraviolet and violet light). Conversely, at wavelengths above 700 nm (red and infrared light) soil has relatively high reflectance, while water has very low reflectance. Vegetation, meanwhile, generally reflects large amounts of near infrared light, relative to other land covers.</p>
|
<p>If we graph the amount of light (reflectance) at different wavelengths that an object or land cover reflects, we can visualize this more easily (Fig. F2.0.2). For example, look at the reflectance curves for soil and water in the graph below. Soil and water both have relatively low reflectance at wavelengths around 300 nm (ultraviolet and violet light). Conversely, at wavelengths above 700 nm (red and infrared light) soil has relatively high reflectance, while water has very low reflectance. Vegetation, meanwhile, generally reflects large amounts of near infrared light, relative to other land covers.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image32.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image32.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.2 A graph of the amount of reflectance for different objects on the Earth’s surface at different wavelengths in the visible and infrared portions of the electromagnetic spectrum. 1 micrometer (µm) = 1,000 nanometers (nm).</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.2 A graph of the amount of reflectance for different objects on the Earth’s surface at different wavelengths in the visible and infrared portions of the electromagnetic spectrum. 1 micrometer (µm) = 1,000 nanometers (nm).</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Spectral indices use math to express how objects reflect light across multiple portions of the spectrum as a single number. Indices combine multiple bands, often with simple operations of subtraction and division, to create a single value across an image that is intended to help to distinguish particular land uses or land covers of interest. Using Fig. F2.0.2, you can imagine which wavelengths might be the most informative for distinguishing among a variety of land covers. We will explore a variety of calculations made from combinations of bands in the following sections.</p>
|
<p>Spectral indices use math to express how objects reflect light across multiple portions of the spectrum as a single number. Indices combine multiple bands, often with simple operations of subtraction and division, to create a single value across an image that is intended to help to distinguish particular land uses or land covers of interest. Using Fig. F2.0.2, you can imagine which wavelengths might be the most informative for distinguishing among a variety of land covers. We will explore a variety of calculations made from combinations of bands in the following sections.</p>
|
||||||
<p>Indices derived from satellite imagery are used as the basis of many remote-sensing analyses. Indices have been used in thousands of applications, from detecting anthropogenic deforestation to examining crop health. For example, the growth of economically important crops such as wheat and cotton can be monitored throughout the growing season: Bare soil reflects more red wavelengths, whereas growing crops reflect more of the near-infrared (NIR) wavelengths. Thus, calculating a ratio of these two bands can help monitor how well crops are growing (Jackson and Huete 1991).</p>
|
<p>Indices derived from satellite imagery are used as the basis of many remote-sensing analyses. Indices have been used in thousands of applications, from detecting anthropogenic deforestation to examining crop health. For example, the growth of economically important crops such as wheat and cotton can be monitored throughout the growing season: Bare soil reflects more red wavelengths, whereas growing crops reflect more of the near-infrared (NIR) wavelengths. Thus, calculating a ratio of these two bands can help monitor how well crops are growing (Jackson and Huete 1991).</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="band-arithmetic-in-earth-engine" class="level3" data-number="5.1.1">
|
<section id="band-arithmetic-in-earth-engine" class="level3">
|
||||||
<h3 data-number="5.1.1" class="anchored" data-anchor-id="band-arithmetic-in-earth-engine"><span class="header-section-number">5.1.1</span> Band Arithmetic in Earth Engine</h3>
|
<h3 class="anchored" data-anchor-id="band-arithmetic-in-earth-engine">Band Arithmetic in Earth Engine</h3>
|
||||||
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829783542&usg=AOvVaw2f8xfEZP6c0zP_Ke8jL26U"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829783919&usg=AOvVaw2i09J44MzpMZkjV_JLEnNR">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829784270&usg=AOvVaw1Kr82KG60ZeFLYC8cOZ67A">this link</a> for help.</p>
|
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829783542&usg=AOvVaw2f8xfEZP6c0zP_Ke8jL26U"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829783919&usg=AOvVaw2i09J44MzpMZkjV_JLEnNR">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829784270&usg=AOvVaw1Kr82KG60ZeFLYC8cOZ67A">this link</a> for help.</p>
|
||||||
<p>Many indices can be calculated using band arithmetic in Earth Engine. Band arithmetic is the process of adding, subtracting, multiplying, or dividing two or more bands from an image. Here we’ll first do this manually, and then show you some more efficient ways to perform band arithmetic in Earth Engine.</p>
|
<p>Many indices can be calculated using band arithmetic in Earth Engine. Band arithmetic is the process of adding, subtracting, multiplying, or dividing two or more bands from an image. Here we’ll first do this manually, and then show you some more efficient ways to perform band arithmetic in Earth Engine.</p>
|
||||||
<section id="arithmetic-calculation-of-ndvi" class="level4" data-number="5.1.1.1">
|
<section id="arithmetic-calculation-of-ndvi" class="level4">
|
||||||
<h4 data-number="5.1.1.1" class="anchored" data-anchor-id="arithmetic-calculation-of-ndvi"><span class="header-section-number">5.1.1.1</span> Arithmetic Calculation of NDVI</h4>
|
<h4 class="anchored" data-anchor-id="arithmetic-calculation-of-ndvi">Arithmetic Calculation of NDVI</h4>
|
||||||
<p>The red and near-infrared bands provide a lot of information about vegetation due to vegetation’s high reflectance in these wavelengths. Take a look at Fig. F2.0.2 and note, in particular, that vegetation curves (graphed in green) have relatively high reflectance in the NIR range (approximately 750–900 nm). Also note that vegetation has low reflectance in the red range (approximately 630–690 nm), where sunlight is absorbed by chlorophyll. This suggests that if the red and near-infrared bands could be combined, they would provide substantial information about vegetation.</p>
|
<p>The red and near-infrared bands provide a lot of information about vegetation due to vegetation’s high reflectance in these wavelengths. Take a look at Fig. F2.0.2 and note, in particular, that vegetation curves (graphed in green) have relatively high reflectance in the NIR range (approximately 750–900 nm). Also note that vegetation has low reflectance in the red range (approximately 630–690 nm), where sunlight is absorbed by chlorophyll. This suggests that if the red and near-infrared bands could be combined, they would provide substantial information about vegetation.</p>
|
||||||
<p>Soon after the launch of Landsat 1 in 1972, analysts worked to devise a robust single value that would convey the health of vegetation along a scale of −1 to 1. This yielded the NDVI, using the formula:</p>
|
<p>Soon after the launch of Landsat 1 in 1972, analysts worked to devise a robust single value that would convey the health of vegetation along a scale of −1 to 1. This yielded the NDVI, using the formula:</p>
|
||||||
<p><img src="../images/F2/image1.png" class="img-fluid"> (F2.0.1)</p>
|
<p><img src="images/F2/image1.png" class="img-fluid"> (F2.0.1)</p>
|
||||||
<p>where NIR and red refer to the brightness of each of those two bands. As seen in Chaps. F1.1 and F1.2, this brightness might be conveyed in units of reflectance, radiance, or digital number (DN); the NDVI is intended to give nearly equivalent values across platforms that use these wavelengths. The general form of this equation is called a “normalized difference”—the numerator is the “difference” and the denominator “normalizes” the value. Outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.</p>
|
<p>where NIR and red refer to the brightness of each of those two bands. As seen in Chaps. F1.1 and F1.2, this brightness might be conveyed in units of reflectance, radiance, or digital number (DN); the NDVI is intended to give nearly equivalent values across platforms that use these wavelengths. The general form of this equation is called a “normalized difference”—the numerator is the “difference” and the denominator “normalizes” the value. Outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.</p>
|
||||||
<p>To compute the NDVI, we will introduce Earth Engine’s implementation of band arithmetic. Cloud-based band arithmetic is one of the most powerful aspects of Earth Engine, because the platform’s computers are optimized for this type of heavy processing. Arithmetic on bands can be done even at planetary scale very quickly—an idea that was out of reach before the advent of cloud-based remote sensing. Earth Engine automatically partitions calculations across a large number of computers as needed, and assembles the answer for display.</p>
|
<p>To compute the NDVI, we will introduce Earth Engine’s implementation of band arithmetic. Cloud-based band arithmetic is one of the most powerful aspects of Earth Engine, because the platform’s computers are optimized for this type of heavy processing. Arithmetic on bands can be done even at planetary scale very quickly—an idea that was out of reach before the advent of cloud-based remote sensing. Earth Engine automatically partitions calculations across a large number of computers as needed, and assembles the answer for display.</p>
|
||||||
<p>As an example, let’s examine an image of San Francisco (Fig. F2.0.3).</p>
|
<p>As an example, let’s examine an image of San Francisco (Fig. F2.0.3).</p>
|
||||||
@@ -435,7 +423,7 @@ Chapter Information
|
|||||||
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb1-20"><a href="#cb1-20" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image46.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image46.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.3 False color Sentinel-2 imagery of San Francisco and surroundings</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.3 False color Sentinel-2 imagery of San Francisco and surroundings</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -462,14 +450,14 @@ Chapter Information
|
|||||||
<p>Examine the resulting index, using the Inspector to pick out pixel values in areas of vegetation and non-vegetation if desired.</p>
|
<p>Examine the resulting index, using the Inspector to pick out pixel values in areas of vegetation and non-vegetation if desired.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image50.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image50.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.4 NDVI calculated using Sentinel-2. Remember that outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.4 NDVI calculated using Sentinel-2. Remember that outputs for NDVI vary between −1 and 1. High amounts of green vegetation have values around 0.8–0.9. Absence of green leaves gives values near 0, and water gives values near −1.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Using these simple arithmetic tools, you can build almost any index, or develop and visualize your own. Earth Engine allows you to quickly and easily calculate and display the index across a large area.</p>
|
<p>Using these simple arithmetic tools, you can build almost any index, or develop and visualize your own. Earth Engine allows you to quickly and easily calculate and display the index across a large area.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="single-operation-computation-of-normalized-difference-for-ndvi" class="level4" data-number="5.1.1.2">
|
<section id="single-operation-computation-of-normalized-difference-for-ndvi" class="level4">
|
||||||
<h4 data-number="5.1.1.2" class="anchored" data-anchor-id="single-operation-computation-of-normalized-difference-for-ndvi"><span class="header-section-number">5.1.1.2</span> Single-Operation Computation of Normalized Difference for NDVI</h4>
|
<h4 class="anchored" data-anchor-id="single-operation-computation-of-normalized-difference-for-ndvi">Single-Operation Computation of Normalized Difference for NDVI</h4>
|
||||||
<p>Normalized differences like NDVI are so common in remote sensing that Earth Engine provides the ability to do that particular sequence of subtraction, addition, and division in a single step, using the normalizedDifference method. This method takes an input image, along with bands you specify, and creates a normalized difference of those two bands. The NDVI computation previously created with band arithmetic can be replaced with one line of code:</p>
|
<p>Normalized differences like NDVI are so common in remote sensing that Earth Engine provides the ability to do that particular sequence of subtraction, addition, and division in a single step, using the normalizedDifference method. This method takes an input image, along with bands you specify, and creates a normalized difference of those two bands. The NDVI computation previously created with band arithmetic can be replaced with one line of code:</p>
|
||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Now use the built-in normalizedDifference function to achieve the same outcome. </span></span>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Now use the built-in normalizedDifference function to achieve the same outcome. </span></span>
|
||||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndviND <span class="op">=</span> sfoImage<span class="op">.</span><span class="fu">normalizedDifference</span>([<span class="st">'B8'</span><span class="op">,</span> <span class="st">'B4'</span>])<span class="op">;</span> </span>
|
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndviND <span class="op">=</span> sfoImage<span class="op">.</span><span class="fu">normalizedDifference</span>([<span class="st">'B8'</span><span class="op">,</span> <span class="st">'B4'</span>])<span class="op">;</span> </span>
|
||||||
@@ -481,13 +469,13 @@ Chapter Information
|
|||||||
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>Note that the order in which you provide the two bands to normalizedDifference is important. We use B8, the near-infrared band, as the first parameter, and the red band B4 as the second. If your two computations of NDVI do not look identical when drawn to the screen, check to make sure that the order you have for the NIR and red bands is correct.</p>
|
<p>Note that the order in which you provide the two bands to normalizedDifference is important. We use B8, the near-infrared band, as the first parameter, and the red band B4 as the second. If your two computations of NDVI do not look identical when drawn to the screen, check to make sure that the order you have for the NIR and red bands is correct.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="using-normalized-difference-for-ndwi" class="level4" data-number="5.1.1.3">
|
<section id="using-normalized-difference-for-ndwi" class="level4">
|
||||||
<h4 data-number="5.1.1.3" class="anchored" data-anchor-id="using-normalized-difference-for-ndwi"><span class="header-section-number">5.1.1.3</span> Using Normalized Difference for NDWI</h4>
|
<h4 class="anchored" data-anchor-id="using-normalized-difference-for-ndwi">Using Normalized Difference for NDWI</h4>
|
||||||
<p>As mentioned, the normalized difference approach is used for many different indices. Let’s apply the same normalizedDifference method to another index.</p>
|
<p>As mentioned, the normalized difference approach is used for many different indices. Let’s apply the same normalizedDifference method to another index.</p>
|
||||||
<p>The Normalized Difference Water Index (NDWI) was developed by Gao (1996) as an index of vegetation water content. The index is sensitive to changes in the liquid content of vegetation canopies. This means that the index can be used, for example, to detect vegetation experiencing drought conditions or differentiate crop irrigation levels. In dry areas, crops that are irrigated can be differentiated from natural vegetation. It is also sometimes called the Normalized Difference Moisture Index (NDMI). NDWI is formulated as follows:</p>
|
<p>The Normalized Difference Water Index (NDWI) was developed by Gao (1996) as an index of vegetation water content. The index is sensitive to changes in the liquid content of vegetation canopies. This means that the index can be used, for example, to detect vegetation experiencing drought conditions or differentiate crop irrigation levels. In dry areas, crops that are irrigated can be differentiated from natural vegetation. It is also sometimes called the Normalized Difference Moisture Index (NDMI). NDWI is formulated as follows:</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image2.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image2.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">(F2.0.2)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">(F2.0.2)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -505,7 +493,7 @@ Chapter Information
|
|||||||
<p>Examine the areas of the map that NDVI identified as having a lot of vegetation. Notice which are more blue. This is vegetation that has higher water content.</p>
|
<p>Examine the areas of the map that NDVI identified as having a lot of vegetation. Notice which are more blue. This is vegetation that has higher water content.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image40.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image40.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.5 NDWI displayed for Sentinel-2 over San Francisco</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.5 NDWI displayed for Sentinel-2 over San Francisco</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -524,11 +512,11 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="thresholding-masking-and-remapping-images" class="level3" data-number="5.1.2">
|
<section id="thresholding-masking-and-remapping-images" class="level3">
|
||||||
<h3 data-number="5.1.2" class="anchored" data-anchor-id="thresholding-masking-and-remapping-images"><span class="header-section-number">5.1.2</span> Thresholding, Masking, and Remapping Images</h3>
|
<h3 class="anchored" data-anchor-id="thresholding-masking-and-remapping-images">Thresholding, Masking, and Remapping Images</h3>
|
||||||
<p>The previous section in this chapter discussed how to use band arithmetic to manipulate images. Those methods created new continuous values by combining bands within an image. This section uses logical operators to categorize band or index values to create a categorized image.</p>
|
<p>The previous section in this chapter discussed how to use band arithmetic to manipulate images. Those methods created new continuous values by combining bands within an image. This section uses logical operators to categorize band or index values to create a categorized image.</p>
|
||||||
<section id="implementing-a-threshold" class="level4" data-number="5.1.2.1">
|
<section id="implementing-a-threshold" class="level4">
|
||||||
<h4 data-number="5.1.2.1" class="anchored" data-anchor-id="implementing-a-threshold"><span class="header-section-number">5.1.2.1</span> Implementing a Threshold</h4>
|
<h4 class="anchored" data-anchor-id="implementing-a-threshold">Implementing a Threshold</h4>
|
||||||
<p>Implementing a threshold uses a number (the threshold value) and logical operators to help us partition the variability of images into categories. For example, recall our map of NDVI. High amounts of vegetation have NDVI values near 1 and non-vegetated areas are near 0. If we want to see what areas of the map have vegetation, we can use a threshold to generalize the NDVI value in each pixel as being either “no vegetation” or “vegetation”. That is a substantial simplification, to be sure, but can help us to better comprehend the rich variation on the Earth’s surface. This type of categorization may be useful if, for example, we want to look at the proportion of a city that is vegetated. Let’s create a Sentinel-2 map of NDVI near Seattle, Washington, USA. Enter the code below in a new script.</p>
|
<p>Implementing a threshold uses a number (the threshold value) and logical operators to help us partition the variability of images into categories. For example, recall our map of NDVI. High amounts of vegetation have NDVI values near 1 and non-vegetated areas are near 0. If we want to see what areas of the map have vegetation, we can use a threshold to generalize the NDVI value in each pixel as being either “no vegetation” or “vegetation”. That is a substantial simplification, to be sure, but can help us to better comprehend the rich variation on the Earth’s surface. This type of categorization may be useful if, for example, we want to look at the proportion of a city that is vegetated. Let’s create a Sentinel-2 map of NDVI near Seattle, Washington, USA. Enter the code below in a new script.</p>
|
||||||
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Create an NDVI image using Sentinel 2. </span></span>
|
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Create an NDVI image using Sentinel 2. </span></span>
|
||||||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> seaPoint <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">122.2040</span><span class="op">,</span> <span class="fl">47.6221</span>)<span class="op">;</span> </span>
|
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> seaPoint <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">122.2040</span><span class="op">,</span> <span class="fl">47.6221</span>)<span class="op">;</span> </span>
|
||||||
@@ -551,7 +539,7 @@ Note
|
|||||||
<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb5-19"><a href="#cb5-19" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image30.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image30.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.6 NDVI image of Sentinel-2 imagery over Seattle, Washington, USA</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.6 NDVI image of Sentinel-2 imagery over Seattle, Washington, USA</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -571,15 +559,15 @@ Note
|
|||||||
<p>The gt method is from the family of Boolean operators — that is, gt is a function that performs a test in each pixel and returns the value 1 if the test evaluates to true, and 0 otherwise. Here, for every pixel in the image, it tests whether the NDVI value is greater than 0.5. When this condition is met, the layer seaVeg gets the value 1. When the condition is false, it receives the value 0.</p>
|
<p>The gt method is from the family of Boolean operators — that is, gt is a function that performs a test in each pixel and returns the value 1 if the test evaluates to true, and 0 otherwise. Here, for every pixel in the image, it tests whether the NDVI value is greater than 0.5. When this condition is met, the layer seaVeg gets the value 1. When the condition is false, it receives the value 0.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image47.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image47.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.7 Thresholded forest and non-forest image based on NDVI for Seattle, Washington, USA</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.7 Thresholded forest and non-forest image based on NDVI for Seattle, Washington, USA</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Use the Inspector tool to explore this new layer. If you click on a green location, that NDVI should be greater than 0.5. If you click on a white pixel, the NDVI value should be equal to or less than 0.5.</p>
|
<p>Use the Inspector tool to explore this new layer. If you click on a green location, that NDVI should be greater than 0.5. If you click on a white pixel, the NDVI value should be equal to or less than 0.5.</p>
|
||||||
<p>Other operators in this Boolean family include less than (lt), less than or equal to (lte), equal to (eq), not equal to (neq), and greater than or equal to (gte) and more.</p>
|
<p>Other operators in this Boolean family include less than (lt), less than or equal to (lte), equal to (eq), not equal to (neq), and greater than or equal to (gte) and more.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="building-complex-categorizations-with-.where" class="level4" data-number="5.1.2.2">
|
<section id="building-complex-categorizations-with-.where" class="level4">
|
||||||
<h4 data-number="5.1.2.2" class="anchored" data-anchor-id="building-complex-categorizations-with-.where"><span class="header-section-number">5.1.2.2</span> Building Complex Categorizations with .where</h4>
|
<h4 class="anchored" data-anchor-id="building-complex-categorizations-with-.where">Building Complex Categorizations with .where</h4>
|
||||||
<p>A binary map classifying NDVI is very useful. However, there are situations where you may want to split your image into more than two bins. Earth Engine provides a tool, the where method, that conditionally evaluates to true or false within each pixel depending on the outcome of a test. This is analogous to an if statement seen commonly in other languages. However, to perform this logic when programming for Earth Engine, we avoid using the JavaScript if statement. Importantly, JavaScript if commands are not calculated on Google’s servers, and can create serious problems when running your code — in effect, the servers try to ship all of the information to be executed to your own computer’s browser, which is very underequipped for such enormous tasks. Instead, we use the where clause for conditional logic.</p>
|
<p>A binary map classifying NDVI is very useful. However, there are situations where you may want to split your image into more than two bins. Earth Engine provides a tool, the where method, that conditionally evaluates to true or false within each pixel depending on the outcome of a test. This is analogous to an if statement seen commonly in other languages. However, to perform this logic when programming for Earth Engine, we avoid using the JavaScript if statement. Importantly, JavaScript if commands are not calculated on Google’s servers, and can create serious problems when running your code — in effect, the servers try to ship all of the information to be executed to your own computer’s browser, which is very underequipped for such enormous tasks. Instead, we use the where clause for conditional logic.</p>
|
||||||
<p>Suppose instead of just splitting the forested areas from the non-forested areas in our NDVI, we want to split the image into likely water, non-forested and forested areas. We can use where and thresholds of -0.1 and 0.5. We will start by creating an image using ee.Image. We then clip the new image so that it covers the same area as our seaNDVI layer.</p>
|
<p>Suppose instead of just splitting the forested areas from the non-forested areas in our NDVI, we want to split the image into likely water, non-forested and forested areas. We can use where and thresholds of -0.1 and 0.5. We will start by creating an image using ee.Image. We then clip the new image so that it covers the same area as our seaNDVI layer.</p>
|
||||||
<div class="sourceCode" id="cb7"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Implement .where. </span></span>
|
<div class="sourceCode" id="cb7"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Implement .where. </span></span>
|
||||||
@@ -603,13 +591,13 @@ Note
|
|||||||
<p>There are a few interesting things to note about this code that you may not have seen before. First, we’re not defining a new variable for each where call. As a result, we can perform many where calls without creating a new variable each time and needing to keep track of them. Second, when we created the starting image, we set the value to 1. This means that we could easily set the bottom and top values with one where clause each. Finally, while we did not do it here, we can combine multiple where clauses using and and or. For example, we could identify pixels with an intermediate level of NDVI using seaNDVI.gte(-0.1).and(seaNDVI.lt(0.5)).</p>
|
<p>There are a few interesting things to note about this code that you may not have seen before. First, we’re not defining a new variable for each where call. As a result, we can perform many where calls without creating a new variable each time and needing to keep track of them. Second, when we created the starting image, we set the value to 1. This means that we could easily set the bottom and top values with one where clause each. Finally, while we did not do it here, we can combine multiple where clauses using and and or. For example, we could identify pixels with an intermediate level of NDVI using seaNDVI.gte(-0.1).and(seaNDVI.lt(0.5)).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image37.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image37.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.8 Thresholded water, forest, and non-forest image based on NDVI for Seattle, Washington, USA.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.8 Thresholded water, forest, and non-forest image based on NDVI for Seattle, Washington, USA.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="masking-specific-values-in-an-image" class="level4" data-number="5.1.2.3">
|
<section id="masking-specific-values-in-an-image" class="level4">
|
||||||
<h4 data-number="5.1.2.3" class="anchored" data-anchor-id="masking-specific-values-in-an-image"><span class="header-section-number">5.1.2.3</span> Masking Specific Values in an Image</h4>
|
<h4 class="anchored" data-anchor-id="masking-specific-values-in-an-image">Masking Specific Values in an Image</h4>
|
||||||
<p>Masking an image is a technique that removes specific areas of an image — those covered by the mask — from being displayed or analyzed. Earth Engine allows you to both view the current mask and update the mask.</p>
|
<p>Masking an image is a technique that removes specific areas of an image — those covered by the mask — from being displayed or analyzed. Earth Engine allows you to both view the current mask and update the mask.</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">// Implement masking. </span></span>
|
<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">// Implement masking. </span></span>
|
||||||
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="co">// View the seaVeg layer's current mask. </span></span>
|
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="co">// View the seaVeg layer's current mask. </span></span>
|
||||||
@@ -618,7 +606,7 @@ Note
|
|||||||
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb8-5"><a href="#cb8-5" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image23.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image23.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.9 The existing mask for the seaVeg layer we created previously</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.9 The existing mask for the seaVeg layer we created previously</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -642,7 +630,7 @@ Note
|
|||||||
<p>Turn off all of the other layers. You can see how the maskedVeg layer now has masked out all non-forested areas.</p>
|
<p>Turn off all of the other layers. You can see how the maskedVeg layer now has masked out all non-forested areas.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image26.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image26.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.10 An updated mask now displays only the forested areas. Non-forested areas are masked out and transparent.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.10 An updated mask now displays only the forested areas. Non-forested areas are masked out and transparent.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -652,13 +640,13 @@ Note
|
|||||||
<span id="cb11-3"><a href="#cb11-3" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb11-3"><a href="#cb11-3" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image33.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image33.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.11 The updated mask. Areas of non-forest are now masked out as well (black areas of the image).</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.11 The updated mask. Areas of non-forest are now masked out as well (black areas of the image).</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="remapping-values-in-an-image" class="level4" data-number="5.1.2.4">
|
<section id="remapping-values-in-an-image" class="level4">
|
||||||
<h4 data-number="5.1.2.4" class="anchored" data-anchor-id="remapping-values-in-an-image"><span class="header-section-number">5.1.2.4</span> Remapping Values in an Image</h4>
|
<h4 class="anchored" data-anchor-id="remapping-values-in-an-image">Remapping Values in an Image</h4>
|
||||||
<p>Remapping takes specific values in an image and assigns them a different value. This is particularly useful for categorical datasets, including those you read about in Chap. F1.2 and those we have created earlier in this chapter.</p>
|
<p>Remapping takes specific values in an image and assigns them a different value. This is particularly useful for categorical datasets, including those you read about in Chap. F1.2 and those we have created earlier in this chapter.</p>
|
||||||
<p>Let’s use the remap method to change the values for our seaWhere layer. Note that since we’re changing the middle value to be the largest, we’ll need to adjust our palette as well.</p>
|
<p>Let’s use the remap method to change the values for our seaWhere layer. Note that since we’re changing the middle value to be the largest, we’ll need to adjust our palette as well.</p>
|
||||||
<div class="sourceCode" id="cb12"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Implement remapping. </span></span>
|
<div class="sourceCode" id="cb12"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Implement remapping. </span></span>
|
||||||
@@ -675,7 +663,7 @@ Note
|
|||||||
<p>Use the inspector to compare values between our original seaWhere (displayed as Water, Non-Forest, Forest) and the seaRemap, marked as “Remapped Values.” Click on a forested area and you should see that the Remapped Values should be 10, instead of 2 (Fig. F2.0.12).</p>
|
<p>Use the inspector to compare values between our original seaWhere (displayed as Water, Non-Forest, Forest) and the seaRemap, marked as “Remapped Values.” Click on a forested area and you should see that the Remapped Values should be 10, instead of 2 (Fig. F2.0.12).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image28.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image28.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.0.12 For forested areas, the remapped layer has a value of 10, compared with the original layer, which has a value of 2. You may have more layers in your Inspector.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.0.12 For forested areas, the remapped layer has a value of 10, compared with the original layer, which has a value of 2. You may have more layers in your Inspector.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -715,8 +703,8 @@ Note
|
|||||||
<p>Souza Jr CM, Siqueira JV, Sales MH, et al (2013) Ten-year Landsat classification of deforestation and forest degradation in the Brazilian Amazon. Remote Sens 5:5493–5513. https://doi.org/10.3390/rs5115493</p>
|
<p>Souza Jr CM, Siqueira JV, Sales MH, et al (2013) Ten-year Landsat classification of deforestation and forest degradation in the Brazilian Amazon. Remote Sens 5:5493–5513. https://doi.org/10.3390/rs5115493</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="interpreting-an-image-classification" class="level2" data-number="5.2">
|
<section id="interpreting-an-image-classification" class="level2">
|
||||||
<h2 data-number="5.2" class="anchored" data-anchor-id="interpreting-an-image-classification"><span class="header-section-number">5.2</span> Interpreting an Image: Classification</h2>
|
<h2 class="anchored" data-anchor-id="interpreting-an-image-classification">Interpreting an Image: Classification</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -760,15 +748,15 @@ Chapter Information
|
|||||||
<p>In remote sensing, image classification is an attempt to categorize all pixels in an image into a finite number of labeled land cover and/or land use classes. The resulting classified image is a simplified thematic map derived from the original image (Fig. F2.1.1). Land cover and land use information is essential for many environmental and socioeconomic applications, including natural resource management, urban planning, biodiversity conservation, agricultural monitoring and carbon accounting.</p>
|
<p>In remote sensing, image classification is an attempt to categorize all pixels in an image into a finite number of labeled land cover and/or land use classes. The resulting classified image is a simplified thematic map derived from the original image (Fig. F2.1.1). Land cover and land use information is essential for many environmental and socioeconomic applications, including natural resource management, urban planning, biodiversity conservation, agricultural monitoring and carbon accounting.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image48.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image48.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.1 Image classification concept</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.1 Image classification concept</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Image classification techniques for generating land cover and land use information have been in use since the 1980s (Li et al. 2014). Here, we will cover the concepts of pixel-based supervised and unsupervised classifications, testing out different classifiers. Chapter F3.3 covers the concept and application of object-based classification.</p>
|
<p>Image classification techniques for generating land cover and land use information have been in use since the 1980s (Li et al. 2014). Here, we will cover the concepts of pixel-based supervised and unsupervised classifications, testing out different classifiers. Chapter F3.3 covers the concept and application of object-based classification.</p>
|
||||||
<p>It is important to define land use and land cover. Land cover relates to the physical characteristics of the surface: simply put, it documents whether an area of the Earth’s surface is covered by forests, water, impervious surfaces, etc. Land use refers to how this land is being used by people. For example, herbaceous vegetation is considered a land cover but can indicate different land uses: the grass in a pasture is an agricultural land use, whereas the grass in an urban area can be classified as a park.</p>
|
<p>It is important to define land use and land cover. Land cover relates to the physical characteristics of the surface: simply put, it documents whether an area of the Earth’s surface is covered by forests, water, impervious surfaces, etc. Land use refers to how this land is being used by people. For example, herbaceous vegetation is considered a land cover but can indicate different land uses: the grass in a pasture is an agricultural land use, whereas the grass in an urban area can be classified as a park.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="supervised-classification" class="level3" data-number="5.2.1">
|
<section id="supervised-classification" class="level3">
|
||||||
<h3 data-number="5.2.1" class="anchored" data-anchor-id="supervised-classification"><span class="header-section-number">5.2.1</span> Supervised Classification</h3>
|
<h3 class="anchored" data-anchor-id="supervised-classification">Supervised Classification</h3>
|
||||||
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829866098&usg=AOvVaw16x5swm9HlorS5Mbw7E42X"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829866485&usg=AOvVaw0-N-JCWWgnM493BKa7Ichm">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829866823&usg=AOvVaw0ytMyRvutssBcVr2GdcBHA">this link</a> for help.</p>
|
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829866098&usg=AOvVaw16x5swm9HlorS5Mbw7E42X"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829866485&usg=AOvVaw0-N-JCWWgnM493BKa7Ichm">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829866823&usg=AOvVaw0ytMyRvutssBcVr2GdcBHA">this link</a> for help.</p>
|
||||||
<p>Supervised classification uses a training dataset with known labels and representing the spectral characteristics of each land cover class of interest to “supervise” the classification. The overall approach of a supervised classification in Earth Engine is summarized as follows:</p>
|
<p>Supervised classification uses a training dataset with known labels and representing the spectral characteristics of each land cover class of interest to “supervise” the classification. The overall approach of a supervised classification in Earth Engine is summarized as follows:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
@@ -801,7 +789,7 @@ Chapter Information
|
|||||||
<span id="cb13-21"><a href="#cb13-21" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb13-21"><a href="#cb13-21" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image44.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image44.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.2 Landsat image</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.2 Landsat image</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -815,7 +803,7 @@ Chapter Information
|
|||||||
<p>In the Geometry Tools, click on the marker option (Fig. F2.1.3). This will create a point geometry which will show up as an import named “geometry”. Click on the gear icon to configure this import.</p>
|
<p>In the Geometry Tools, click on the marker option (Fig. F2.1.3). This will create a point geometry which will show up as an import named “geometry”. Click on the gear icon to configure this import.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image22.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image22.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.3 Creating a new layer in the Geometry Imports</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.3 Creating a new layer in the Geometry Imports</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -824,35 +812,35 @@ Chapter Information
|
|||||||
<p>Returning to the coloring of the forest points, the hexadecimal value “589400” is a little bit of red, about twice as much green and no blue: the deep green seen in Figure F2.1.4. Enter that value, with or without the “#” in front, and click OK after finishing the configuration.</p>
|
<p>Returning to the coloring of the forest points, the hexadecimal value “589400” is a little bit of red, about twice as much green and no blue: the deep green seen in Figure F2.1.4. Enter that value, with or without the “#” in front, and click OK after finishing the configuration.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image36.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image36.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.4 Edit geometry layer properties</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.4 Edit geometry layer properties</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Now, in the Geometry Imports, we will see that the import has been renamed forest. Click on it to activate the drawing mode (Fig. F2.1.5) in order to start collecting forest points.</p>
|
<p>Now, in the Geometry Imports, we will see that the import has been renamed forest. Click on it to activate the drawing mode (Fig. F2.1.5) in order to start collecting forest points.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image29.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image29.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.5 Activate forest layer to start collection</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.5 Activate forest layer to start collection</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Now, start collecting points over forested areas (Fig. F2.1.6). Zoom in and out as needed. You can use the satellite basemap to assist you, but the basis of your collection should be the Landsat image. Remember that the more points you collect, the more the classifier will learn from the information you provide. For now, let’s set a goal to collect 25 points per class. Click Exit next to Point drawing (Fig. F2.1.5) when finished.</p>
|
<p>Now, start collecting points over forested areas (Fig. F2.1.6). Zoom in and out as needed. You can use the satellite basemap to assist you, but the basis of your collection should be the Landsat image. Remember that the more points you collect, the more the classifier will learn from the information you provide. For now, let’s set a goal to collect 25 points per class. Click Exit next to Point drawing (Fig. F2.1.5) when finished.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image38.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image38.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.6 Forest points</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.6 Forest points</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Repeat the same process for the other classes by creating new layers (Fig. F2.1.7). Don’t forget to import using the FeatureCollection option as mentioned above. For the developed class, collect points over urban areas. For the water class, collect points over the Ligurian Sea, and also look for other bodies of water, like rivers. For the herbaceous class, collect points over agricultural fields. Remember to set the “class” property for each class to its corresponding code (see Table 2.1.1) and click Exit once you finalize collecting points for each class as mentioned above. We will be using the following hexadecimal colors for the other classes: #FF0000 for developed, #1A11FF for water, and #D0741E for herbaceous.</p>
|
<p>Repeat the same process for the other classes by creating new layers (Fig. F2.1.7). Don’t forget to import using the FeatureCollection option as mentioned above. For the developed class, collect points over urban areas. For the water class, collect points over the Ligurian Sea, and also look for other bodies of water, like rivers. For the herbaceous class, collect points over agricultural fields. Remember to set the “class” property for each class to its corresponding code (see Table 2.1.1) and click Exit once you finalize collecting points for each class as mentioned above. We will be using the following hexadecimal colors for the other classes: #FF0000 for developed, #1A11FF for water, and #D0741E for herbaceous.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image41.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image41.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.7 New layer option in Geometry Imports</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.7 New layer option in Geometry Imports</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>You should now have four FeatureCollection imports named forest, developed, water, and herbaceous (Fig. F2.1.8).</p>
|
<p>You should now have four FeatureCollection imports named forest, developed, water, and herbaceous (Fig. F2.1.8).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image42.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image42.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.8 Example of training points</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.8 Example of training points</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -893,14 +881,14 @@ Note
|
|||||||
<p>You can check whether the classifierTraining object extracted the properties of interest by printing it and expanding the first feature. You should see the band and class information (Fig. F2.1.9).</p>
|
<p>You can check whether the classifierTraining object extracted the properties of interest by printing it and expanding the first feature. You should see the band and class information (Fig. F2.1.9).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image20.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image20.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.9 Example of extracted band information for one point of class 0 (forest)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.9 Example of extracted band information for one point of class 0 (forest)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Now we can choose a classifier. The choice of classifier is not always obvious, and there are many options from which to pick — you can quickly expand the ee.Classifier object under Docs to get an idea of how many options we have for image classification. Therefore, we will be testing different classifiers and comparing their results. We will start with a Classification and Regression Tree (CART) classifier, a well-known classification algorithm (Fig. F2.1.10) that has been around for decades.</p>
|
<p>Now we can choose a classifier. The choice of classifier is not always obvious, and there are many options from which to pick — you can quickly expand the ee.Classifier object under Docs to get an idea of how many options we have for image classification. Therefore, we will be testing different classifiers and comparing their results. We will start with a Classification and Regression Tree (CART) classifier, a well-known classification algorithm (Fig. F2.1.10) that has been around for decades.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image25.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image25.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.10 Example of a decision tree for satellite image classification. Values and classes are hypothetical.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.10 Example of a decision tree for satellite image classification. Values and classes are hypothetical.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -940,14 +928,14 @@ Note
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image21.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image21.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.11 CART classification</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.11 CART classification</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>For now, we will try another supervised learning classifier that is widely used: Random Forests (RF). The RF algorithm (Breiman 2001, Pal 2005) builds on the concept of decision trees, but adds strategies to make them more powerful. It is called a “forest” because it operates by constructing a multitude of decision trees. As mentioned previously, a decision tree creates the rules which are used to make decisions. A Random Forest will randomly choose features and make observations, build a forest of decision trees and then use the full set of trees to estimate the class. It is a great choice when you do not have a lot of insight about the training data.</p>
|
<p>For now, we will try another supervised learning classifier that is widely used: Random Forests (RF). The RF algorithm (Breiman 2001, Pal 2005) builds on the concept of decision trees, but adds strategies to make them more powerful. It is called a “forest” because it operates by constructing a multitude of decision trees. As mentioned previously, a decision tree creates the rules which are used to make decisions. A Random Forest will randomly choose features and make observations, build a forest of decision trees and then use the full set of trees to estimate the class. It is a great choice when you do not have a lot of insight about the training data.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image27.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image27.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.12 General concept of Random Forests</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.12 General concept of Random Forests</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -972,7 +960,7 @@ Note
|
|||||||
<p>Inspect the result (Fig. F2.1.13). How does this classified image differ from the CART one? Is the classifications better or worse? Zoom in and out and change the transparency of layers as needed. In Chap. F2.2, you will see more systematic ways to assess what is better or worse, based on accuracy metrics.</p>
|
<p>Inspect the result (Fig. F2.1.13). How does this classified image differ from the CART one? Is the classifications better or worse? Zoom in and out and change the transparency of layers as needed. In Chap. F2.2, you will see more systematic ways to assess what is better or worse, based on accuracy metrics.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image34.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image34.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.13 Random Forest classified image</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.13 Random Forest classified image</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -990,8 +978,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="unsupervised-classification" class="level3" data-number="5.2.2">
|
<section id="unsupervised-classification" class="level3">
|
||||||
<h3 data-number="5.2.2" class="anchored" data-anchor-id="unsupervised-classification"><span class="header-section-number">5.2.2</span> Unsupervised Classification</h3>
|
<h3 class="anchored" data-anchor-id="unsupervised-classification">Unsupervised Classification</h3>
|
||||||
<p>In an unsupervised classification, we have the opposite process of supervised classification. Spectral classes are grouped first and then categorized into clusters. Therefore, in Earth Engine, these classifiers are ee.Clusterer objects. They are “self-taught” algorithms that do not use a set of labeled training data (i.e., they are “unsupervised”). You can think of it as performing a task that you have not experienced before, starting by gathering as much information as possible. For example, imagine learning a new language without knowing the basic grammar, learning only by watching a TV series in that language, listening to examples and finding patterns.</p>
|
<p>In an unsupervised classification, we have the opposite process of supervised classification. Spectral classes are grouped first and then categorized into clusters. Therefore, in Earth Engine, these classifiers are ee.Clusterer objects. They are “self-taught” algorithms that do not use a set of labeled training data (i.e., they are “unsupervised”). You can think of it as performing a task that you have not experienced before, starting by gathering as much information as possible. For example, imagine learning a new language without knowing the basic grammar, learning only by watching a TV series in that language, listening to examples and finding patterns.</p>
|
||||||
<p>Similar to the supervised classification, unsupervised classification in Earth Engine has this workflow:</p>
|
<p>Similar to the supervised classification, unsupervised classification in Earth Engine has this workflow:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
@@ -1015,7 +1003,7 @@ Note
|
|||||||
<p>Now we can instantiate a clusterer and train it. As with the supervised algorithms, there are many unsupervised algorithms to choose from. We will use the k-means clustering algorithm, which is a commonly used approach in remote sensing. This algorithm identifies groups of pixels near each other in the spectral space (image x bands) by using an iterative regrouping strategy. We define a number of clusters, k, and then the method randomly distributes that number of seed points into the spectral space. A large sample of pixels is then grouped into its closest seed, and the mean spectral value of this group is calculated. That mean value is akin to a center of mass of the points, and is known as the centroid. Each iteration recalculates the class means and reclassifies pixels with respect to the new means. This process is repeated until the centroids remain relatively stable and only a few pixels change from class to class on subsequent iterations.</p>
|
<p>Now we can instantiate a clusterer and train it. As with the supervised algorithms, there are many unsupervised algorithms to choose from. We will use the k-means clustering algorithm, which is a commonly used approach in remote sensing. This algorithm identifies groups of pixels near each other in the spectral space (image x bands) by using an iterative regrouping strategy. We define a number of clusters, k, and then the method randomly distributes that number of seed points into the spectral space. A large sample of pixels is then grouped into its closest seed, and the mean spectral value of this group is calculated. That mean value is akin to a center of mass of the points, and is known as the centroid. Each iteration recalculates the class means and reclassifies pixels with respect to the new means. This process is repeated until the centroids remain relatively stable and only a few pixels change from class to class on subsequent iterations.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image35.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image35.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.14 K-means visual concept</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.14 K-means visual concept</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1032,7 +1020,7 @@ Note
|
|||||||
<span id="cb21-6"><a href="#cb21-6" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb21-6"><a href="#cb21-6" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image31.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image31.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.1.15 K-means classification</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.1.15 K-means classification</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1069,8 +1057,8 @@ Note
|
|||||||
<p>Witten IH, Frank E, Hall MA, et al (2005) Practical machine learning tools and techniques. In: Data Mining. pp 4</p>
|
<p>Witten IH, Frank E, Hall MA, et al (2005) Practical machine learning tools and techniques. In: Data Mining. pp 4</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="accuracy-assessment-quantifying-classification-quality" class="level2" data-number="5.3">
|
<section id="accuracy-assessment-quantifying-classification-quality" class="level2">
|
||||||
<h2 data-number="5.3" class="anchored" data-anchor-id="accuracy-assessment-quantifying-classification-quality"><span class="header-section-number">5.3</span> Accuracy Assessment: Quantifying Classification Quality</h2>
|
<h2 class="anchored" data-anchor-id="accuracy-assessment-quantifying-classification-quality">Accuracy Assessment: Quantifying Classification Quality</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -1114,8 +1102,8 @@ Chapter Information
|
|||||||
<p>In Chap. F2.1, we asked whether the classification results were satisfactory. In remote sensing, the quantification of the answer to that question is called accuracy assessment. In the classification context, accuracy measurements are often derived from a confusion matrix.</p>
|
<p>In Chap. F2.1, we asked whether the classification results were satisfactory. In remote sensing, the quantification of the answer to that question is called accuracy assessment. In the classification context, accuracy measurements are often derived from a confusion matrix.</p>
|
||||||
<p>In a thorough accuracy assessment, we think carefully about the sampling design, the response design, and the analysis (Olofsson et al. 2014). Fundamental protocols are taken into account to produce scientifically rigorous and transparent estimates of accuracy and area, which requires robust planning and time. In a standard setting, we would calculate the number of samples needed for measuring accuracy (sampling design). Here, we will focus mainly on the last step, analysis, by examining the confusion matrix and learning how to calculate the accuracy metrics. This will be done by partitioning the existing data into training and testing sets.</p>
|
<p>In a thorough accuracy assessment, we think carefully about the sampling design, the response design, and the analysis (Olofsson et al. 2014). Fundamental protocols are taken into account to produce scientifically rigorous and transparent estimates of accuracy and area, which requires robust planning and time. In a standard setting, we would calculate the number of samples needed for measuring accuracy (sampling design). Here, we will focus mainly on the last step, analysis, by examining the confusion matrix and learning how to calculate the accuracy metrics. This will be done by partitioning the existing data into training and testing sets.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="quantifying-classification-accuracy-through-a-confusion-matrix" class="level3" data-number="5.3.1">
|
<section id="quantifying-classification-accuracy-through-a-confusion-matrix" class="level3">
|
||||||
<h3 data-number="5.3.1" class="anchored" data-anchor-id="quantifying-classification-accuracy-through-a-confusion-matrix"><span class="header-section-number">5.3.1</span> Quantifying Classification Accuracy Through a Confusion Matrix</h3>
|
<h3 class="anchored" data-anchor-id="quantifying-classification-accuracy-through-a-confusion-matrix">Quantifying Classification Accuracy Through a Confusion Matrix</h3>
|
||||||
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829937499&usg=AOvVaw3qqOwSX_A-Pllh6X3X31q4"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829937976&usg=AOvVaw0WioXIhzue8-WoaX4UtabH">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829938470&usg=AOvVaw2CH8V3-_qV99EcgMxUAaSO">this link</a> for help.</p>
|
<p>If you have not already done so, be sure to add the book’s 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&sa=D&source=editors&ust=1671458829937499&usg=AOvVaw3qqOwSX_A-Pllh6X3X31q4"></a><a href="https://www.google.com/url?q=https://code.earthengine.google.com/?accept_repo%3Dprojects/gee-edu/book&sa=D&source=editors&ust=1671458829937976&usg=AOvVaw0WioXIhzue8-WoaX4UtabH">https://code.earthengine.google.com/?accept_repo=projects/gee-edu/book</a> into your browser. The book’s 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&sa=D&source=editors&ust=1671458829938470&usg=AOvVaw2CH8V3-_qV99EcgMxUAaSO">this link</a> for help.</p>
|
||||||
<p>To illustrate some of the basic ideas about classification accuracy, we will revisit the data and location of part of Chap. F2.1, where we tested different classifiers and classified a Landsat image of the area around Milan, Italy. We will name this dataset ‘data’. This variable is a FeatureCollection with features containing the “class” values and spectral information of four land cover / land use classes: forest, developed, water, and herbaceous (see Fig. F2.1.8 and Fig. F2.1.9 for a refresher). We will also define a variable, predictionBands, which is a list of bands that will be used for prediction (classification)—the spectral information in the data variable.</p>
|
<p>To illustrate some of the basic ideas about classification accuracy, we will revisit the data and location of part of Chap. F2.1, where we tested different classifiers and classified a Landsat image of the area around Milan, Italy. We will name this dataset ‘data’. This variable is a FeatureCollection with features containing the “class” values and spectral information of four land cover / land use classes: forest, developed, water, and herbaceous (see Fig. F2.1.8 and Fig. F2.1.9 for a refresher). We will also define a variable, predictionBands, which is a list of bands that will be used for prediction (classification)—the spectral information in the data variable.</p>
|
||||||
<p>Class Values:</p>
|
<p>Class Values:</p>
|
||||||
@@ -1228,32 +1216,32 @@ Chapter Information
|
|||||||
</table>
|
</table>
|
||||||
<p>In this case, the classifier correctly identified 307 forest pixels, wrongly classified 18 non-forest pixels as forest, correctly identified 661 non-forest pixels, and wrongly classified 14 forest pixels as non-forest. Therefore, the classifier was correct 968 times and wrong 32 times. Let’s calculate the main accuracy metrics for this example.</p>
|
<p>In this case, the classifier correctly identified 307 forest pixels, wrongly classified 18 non-forest pixels as forest, correctly identified 661 non-forest pixels, and wrongly classified 14 forest pixels as non-forest. Therefore, the classifier was correct 968 times and wrong 32 times. Let’s calculate the main accuracy metrics for this example.</p>
|
||||||
<p>The overall accuracy tells us what proportion of the reference data was classified correctly, and is calculated as the total number of correctly identified pixels divided by the total number of pixels in the sample.</p>
|
<p>The overall accuracy tells us what proportion of the reference data was classified correctly, and is calculated as the total number of correctly identified pixels divided by the total number of pixels in the sample.</p>
|
||||||
<p><img src="../images/F2/image6.png" class="img-fluid"></p>
|
<p><img src="images/F2/image6.png" class="img-fluid"></p>
|
||||||
<p>In this case, the overall accuracy is 96.8%, calculated using (<img src="../images/F2/image7.png" class="img-fluid">.</p>
|
<p>In this case, the overall accuracy is 96.8%, calculated using (<img src="images/F2/image7.png" class="img-fluid">.</p>
|
||||||
<p>Two other important accuracy metrics are the producer’s accuracy and the user’s accuracy, also referred to as the “recall” and the “precision,” respectively. Importantly, these metrics quantify aspects of per-class accuracy.</p>
|
<p>Two other important accuracy metrics are the producer’s accuracy and the user’s accuracy, also referred to as the “recall” and the “precision,” respectively. Importantly, these metrics quantify aspects of per-class accuracy.</p>
|
||||||
<p>The producer’s accuracy is the accuracy of the map from the point of view of the map maker (the “producer”), and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels actually in that class. The producer’s accuracy for a given class tells us the proportion of the pixels in that class that were classified correctly.</p>
|
<p>The producer’s accuracy is the accuracy of the map from the point of view of the map maker (the “producer”), and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels actually in that class. The producer’s accuracy for a given class tells us the proportion of the pixels in that class that were classified correctly.</p>
|
||||||
<p><img src="../images/F2/image8.png" class="img-fluid"></p>
|
<p><img src="images/F2/image8.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F2/image9.png" class="img-fluid"></p>
|
<p><img src="images/F2/image9.png" class="img-fluid"></p>
|
||||||
<p>In this case, the producer’s accuracy for the forest class is 95.6%, calculated using <img src="../images/F2/image10.png" class="img-fluid">). The producer’s accuracy for the non-forest class is 97.3%, calculated from <img src="../images/F2/image11.png" class="img-fluid">).</p>
|
<p>In this case, the producer’s accuracy for the forest class is 95.6%, calculated using <img src="images/F2/image10.png" class="img-fluid">). The producer’s accuracy for the non-forest class is 97.3%, calculated from <img src="images/F2/image11.png" class="img-fluid">).</p>
|
||||||
<p>The user’s accuracy (also called the “consumer’s accuracy”) is the accuracy of the map from the point of view of a map user, and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels claimed to be in that class. The user’s accuracy for a given class tells us the proportion of the pixels identified on the map as being in that class that are actually in that class on the ground.</p>
|
<p>The user’s accuracy (also called the “consumer’s accuracy”) is the accuracy of the map from the point of view of a map user, and is calculated as the number of correctly identified pixels of a given class divided by the total number of pixels claimed to be in that class. The user’s accuracy for a given class tells us the proportion of the pixels identified on the map as being in that class that are actually in that class on the ground.</p>
|
||||||
<p><img src="../images/F2/image12.png" class="img-fluid"></p>
|
<p><img src="images/F2/image12.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F2/image13.png" class="img-fluid"></p>
|
<p><img src="images/F2/image13.png" class="img-fluid"></p>
|
||||||
<p>In this case, the user’s accuracy for the forest class is 94.5%, calculated using <img src="../images/F2/image14.png" class="img-fluid">). The user’s accuracy for the non-forest class is 97.9%, calculated from <img src="../images/F2/image15.png" class="img-fluid">).</p>
|
<p>In this case, the user’s accuracy for the forest class is 94.5%, calculated using <img src="images/F2/image14.png" class="img-fluid">). The user’s accuracy for the non-forest class is 97.9%, calculated from <img src="images/F2/image15.png" class="img-fluid">).</p>
|
||||||
<p>Fig. F2.2.1 helps visualize the rows and columns used to calculate each accuracy.</p>
|
<p>Fig. F2.2.1 helps visualize the rows and columns used to calculate each accuracy.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image43.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image43.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.2.1 Confusion matrix for a binary classification where the classes are “positive” (forest) and “negative” (non-forest), with accuracy metrics</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.2.1 Confusion matrix for a binary classification where the classes are “positive” (forest) and “negative” (non-forest), with accuracy metrics</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>It is very common to talk about two types of error when addressing remote-sensing classification accuracy: omission errors and commission errors. Omission errors refer to the reference pixels that were left out of (omitted from) the correct class in the classified map. In a two-class system, an error of omission in one class will be counted as an error of commission in another class. Omission errors are complementary to the producer’s accuracy.</p>
|
<p>It is very common to talk about two types of error when addressing remote-sensing classification accuracy: omission errors and commission errors. Omission errors refer to the reference pixels that were left out of (omitted from) the correct class in the classified map. In a two-class system, an error of omission in one class will be counted as an error of commission in another class. Omission errors are complementary to the producer’s accuracy.</p>
|
||||||
<p><img src="../images/F2/image16.png" class="img-fluid"></p>
|
<p><img src="images/F2/image16.png" class="img-fluid"></p>
|
||||||
<p>Commission errors refer to the class pixels that were erroneously classified in the map and are complementary to the user’s accuracy.</p>
|
<p>Commission errors refer to the class pixels that were erroneously classified in the map and are complementary to the user’s accuracy.</p>
|
||||||
<p><img src="../images/F2/image17.png" class="img-fluid"></p>
|
<p><img src="images/F2/image17.png" class="img-fluid"></p>
|
||||||
<p>Finally, another commonly used accuracy metric is the kappa coefficient, which evaluates how well the classification performed as compared to random. The value of the kappa coefficient can range from −1 to 1: a negative value indicates that the classification is worse than a random assignment of categories would have been; a value of 0 indicates that the classification is no better or worse than random; and a positive value indicates that the classification is better than random.</p>
|
<p>Finally, another commonly used accuracy metric is the kappa coefficient, which evaluates how well the classification performed as compared to random. The value of the kappa coefficient can range from −1 to 1: a negative value indicates that the classification is worse than a random assignment of categories would have been; a value of 0 indicates that the classification is no better or worse than random; and a positive value indicates that the classification is better than random.</p>
|
||||||
<p><img src="../images/F2/image18.png" class="img-fluid"></p>
|
<p><img src="images/F2/image18.png" class="img-fluid"></p>
|
||||||
<p>The chance agreement is calculated as the sum of the product of row and column totals for each class, and the observed accuracy is the overall accuracy. Therefore, for our example, the kappa coefficient is 0.927.</p>
|
<p>The chance agreement is calculated as the sum of the product of row and column totals for each class, and the observed accuracy is the overall accuracy. Therefore, for our example, the kappa coefficient is 0.927.</p>
|
||||||
<p><img src="../images/F2/image19.png" class="img-fluid"></p>
|
<p><img src="images/F2/image19.png" class="img-fluid"></p>
|
||||||
<p>Now, let’s go back to the script. In Earth Engine, there are API calls for these operations. Note that our confusion matrix will be a 4 x 4 table, since we have four different classes.</p>
|
<p>Now, let’s go back to the script. In Earth Engine, there are API calls for these operations. Note that our confusion matrix will be a 4 x 4 table, since we have four different classes.</p>
|
||||||
<p>Copy and paste the code below to classify the testingSet and get a confusion matrix using the method errorMatrix. Note that the classifier automatically adds a property called “classification,” which is compared to the “class” property of the reference dataset.</p>
|
<p>Copy and paste the code below to classify the testingSet and get a confusion matrix using the method errorMatrix. Note that the classifier automatically adds a property called “classification,” which is compared to the “class” property of the reference dataset.</p>
|
||||||
<div class="sourceCode" id="cb24"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Now, to test the classification (verify model's accuracy), </span></span>
|
<div class="sourceCode" id="cb24"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Now, to test the classification (verify model's accuracy), </span></span>
|
||||||
@@ -1286,8 +1274,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="hyperparameter-tuning" class="level3" data-number="5.3.2">
|
<section id="hyperparameter-tuning" class="level3">
|
||||||
<h3 data-number="5.3.2" class="anchored" data-anchor-id="hyperparameter-tuning"><span class="header-section-number">5.3.2</span> Hyperparameter tuning</h3>
|
<h3 class="anchored" data-anchor-id="hyperparameter-tuning">Hyperparameter tuning</h3>
|
||||||
<p>We can also assess how the number of trees in the Random Forest classifier affects the classification accuracy. Copy and paste the code below to create a function that charts the overall accuracy versus the number of trees used. The code tests from 5 to 100 trees at increments of 5, producing Fig. F2.2.2. (Do not worry too much about fully understanding each item at this stage of your learning. If you want to find out how these operations work, you can see more in Chaps. F4.0 and F4.1.)</p>
|
<p>We can also assess how the number of trees in the Random Forest classifier affects the classification accuracy. Copy and paste the code below to create a function that charts the overall accuracy versus the number of trees used. The code tests from 5 to 100 trees at increments of 5, producing Fig. F2.2.2. (Do not worry too much about fully understanding each item at this stage of your learning. If you want to find out how these operations work, you can see more in Chaps. F4.0 and F4.1.)</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">// Hyperparameter tuning. </span></span>
|
<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">// Hyperparameter tuning. </span></span>
|
||||||
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> numTrees <span class="op">=</span> ee<span class="op">.</span><span class="at">List</span><span class="op">.</span><span class="fu">sequence</span>(<span class="dv">5</span><span class="op">,</span> <span class="dv">100</span><span class="op">,</span> <span class="dv">5</span>)<span class="op">;</span> </span>
|
<span id="cb26-2"><a href="#cb26-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> numTrees <span class="op">=</span> ee<span class="op">.</span><span class="at">List</span><span class="op">.</span><span class="fu">sequence</span>(<span class="dv">5</span><span class="op">,</span> <span class="dv">100</span><span class="op">,</span> <span class="dv">5</span>)<span class="op">;</span> </span>
|
||||||
@@ -1317,7 +1305,7 @@ Note
|
|||||||
<span id="cb26-26"><a href="#cb26-26" aria-hidden="true" tabindex="-1"></a></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb26-26"><a href="#cb26-26" 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F2/image45.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F2/image45.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F2.2.2 Chart showing accuracy per number of Random Forest trees</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F2.2.2 Chart showing accuracy per number of Random Forest trees</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1719,12 +1707,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./B1_Getting_Started.html" class="pagination-link">
|
<a href="./B1_Getting_Started.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Getting Started</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./B3_Image_Series.html" class="pagination-link">
|
<a href="./B3_Image_Series.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">Image Series</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 7 Vectors and Tables</title>
|
<title>Remote Sensing for OSINT - Vectors and Tables</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
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 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link active">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 ">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -303,36 +291,36 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#exploring-vectors" id="toc-exploring-vectors" class="nav-link active" data-scroll-target="#exploring-vectors"><span class="header-section-number">7.1</span> Exploring Vectors</a>
|
<li><a href="#exploring-vectors" id="toc-exploring-vectors" class="nav-link active" data-scroll-target="#exploring-vectors">Exploring Vectors</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#using-geometry-tools-to-create-features-in-earth-engine" id="toc-using-geometry-tools-to-create-features-in-earth-engine" class="nav-link" data-scroll-target="#using-geometry-tools-to-create-features-in-earth-engine"><span class="header-section-number">7.1.1</span> Using Geometry Tools to Create Features in Earth Engine</a></li>
|
<li><a href="#using-geometry-tools-to-create-features-in-earth-engine" id="toc-using-geometry-tools-to-create-features-in-earth-engine" class="nav-link" data-scroll-target="#using-geometry-tools-to-create-features-in-earth-engine">Using Geometry Tools to Create Features in Earth Engine</a></li>
|
||||||
<li><a href="#loading-existing-features-and-feature-collections-in-earth-engine" id="toc-loading-existing-features-and-feature-collections-in-earth-engine" class="nav-link" data-scroll-target="#loading-existing-features-and-feature-collections-in-earth-engine"><span class="header-section-number">7.1.2</span> Loading Existing Features and Feature Collections in Earth Engine</a></li>
|
<li><a href="#loading-existing-features-and-feature-collections-in-earth-engine" id="toc-loading-existing-features-and-feature-collections-in-earth-engine" class="nav-link" data-scroll-target="#loading-existing-features-and-feature-collections-in-earth-engine">Loading Existing Features and Feature Collections in Earth Engine</a></li>
|
||||||
<li><a href="#importing-features-into-earth-engine" id="toc-importing-features-into-earth-engine" class="nav-link" data-scroll-target="#importing-features-into-earth-engine"><span class="header-section-number">7.1.3</span> Importing Features into Earth Engine</a></li>
|
<li><a href="#importing-features-into-earth-engine" id="toc-importing-features-into-earth-engine" class="nav-link" data-scroll-target="#importing-features-into-earth-engine">Importing Features into Earth Engine</a></li>
|
||||||
<li><a href="#filtering-feature-collections-by-attributes" id="toc-filtering-feature-collections-by-attributes" class="nav-link" data-scroll-target="#filtering-feature-collections-by-attributes"><span class="header-section-number">7.1.4</span> Filtering Feature Collections by Attributes</a></li>
|
<li><a href="#filtering-feature-collections-by-attributes" id="toc-filtering-feature-collections-by-attributes" class="nav-link" data-scroll-target="#filtering-feature-collections-by-attributes">Filtering Feature Collections by Attributes</a></li>
|
||||||
<li><a href="#reducing-images-using-feature-geometry" id="toc-reducing-images-using-feature-geometry" class="nav-link" data-scroll-target="#reducing-images-using-feature-geometry"><span class="header-section-number">7.1.5</span> Reducing Images Using Feature Geometry</a></li>
|
<li><a href="#reducing-images-using-feature-geometry" id="toc-reducing-images-using-feature-geometry" class="nav-link" data-scroll-target="#reducing-images-using-feature-geometry">Reducing Images Using Feature Geometry</a></li>
|
||||||
<li><a href="#identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" id="toc-identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" class="nav-link" data-scroll-target="#identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi"><span class="header-section-number">7.1.6</span> Identifying the Block in the Neighborhood Surrounding USF with the Highest NDVI</a></li>
|
<li><a href="#identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" id="toc-identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" class="nav-link" data-scroll-target="#identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi">Identifying the Block in the Neighborhood Surrounding USF with the Highest NDVI</a></li>
|
||||||
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#rastervector-conversions" id="toc-rastervector-conversions" class="nav-link" data-scroll-target="#rastervector-conversions"><span class="header-section-number">7.2</span> Raster/Vector Conversions</a>
|
<li><a href="#rastervector-conversions" id="toc-rastervector-conversions" class="nav-link" data-scroll-target="#rastervector-conversions">Raster/Vector Conversions</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#raster-to-vector-conversion" id="toc-raster-to-vector-conversion" class="nav-link" data-scroll-target="#raster-to-vector-conversion"><span class="header-section-number">7.2.1</span> Raster to Vector Conversion</a></li>
|
<li><a href="#raster-to-vector-conversion" id="toc-raster-to-vector-conversion" class="nav-link" data-scroll-target="#raster-to-vector-conversion">Raster to Vector Conversion</a></li>
|
||||||
<li><a href="#a-more-complex-example" id="toc-a-more-complex-example" class="nav-link" data-scroll-target="#a-more-complex-example"><span class="header-section-number">7.2.2</span> 3. A More Complex Example</a></li>
|
<li><a href="#a-more-complex-example" id="toc-a-more-complex-example" class="nav-link" data-scroll-target="#a-more-complex-example">3. A More Complex Example</a></li>
|
||||||
<li><a href="#vector-to-raster-conversion" id="toc-vector-to-raster-conversion" class="nav-link" data-scroll-target="#vector-to-raster-conversion"><span class="header-section-number">7.2.3</span> Vector-to-Raster Conversion</a></li>
|
<li><a href="#vector-to-raster-conversion" id="toc-vector-to-raster-conversion" class="nav-link" data-scroll-target="#vector-to-raster-conversion">Vector-to-Raster Conversion</a></li>
|
||||||
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
|
<li><a href="#conclusion-1" id="toc-conclusion-1" class="nav-link" data-scroll-target="#conclusion-1">Conclusion</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#zonal-statistics" id="toc-zonal-statistics" class="nav-link" data-scroll-target="#zonal-statistics"><span class="header-section-number">7.3</span> Zonal Statistics</a>
|
<li><a href="#zonal-statistics" id="toc-zonal-statistics" class="nav-link" data-scroll-target="#zonal-statistics">Zonal Statistics</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#functions" id="toc-functions" class="nav-link" data-scroll-target="#functions"><span class="header-section-number">7.3.1</span> Functions</a></li>
|
<li><a href="#functions" id="toc-functions" class="nav-link" data-scroll-target="#functions">Functions</a></li>
|
||||||
<li><a href="#point-collection-creation" id="toc-point-collection-creation" class="nav-link" data-scroll-target="#point-collection-creation"><span class="header-section-number">7.3.2</span> Point Collection Creation</a></li>
|
<li><a href="#point-collection-creation" id="toc-point-collection-creation" class="nav-link" data-scroll-target="#point-collection-creation">Point Collection Creation</a></li>
|
||||||
<li><a href="#neighborhood-statistic-examples" id="toc-neighborhood-statistic-examples" class="nav-link" data-scroll-target="#neighborhood-statistic-examples"><span class="header-section-number">7.3.3</span> Neighborhood Statistic Examples</a></li>
|
<li><a href="#neighborhood-statistic-examples" id="toc-neighborhood-statistic-examples" class="nav-link" data-scroll-target="#neighborhood-statistic-examples">Neighborhood Statistic Examples</a></li>
|
||||||
<li><a href="#additional-notes" id="toc-additional-notes" class="nav-link" data-scroll-target="#additional-notes"><span class="header-section-number">7.3.4</span> Additional Notes</a></li>
|
<li><a href="#additional-notes" id="toc-additional-notes" class="nav-link" data-scroll-target="#additional-notes">Additional Notes</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="#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>
|
<li><a href="#references" id="toc-references" class="nav-link" data-scroll-target="#references">References</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#advanced-vector-operations" id="toc-advanced-vector-operations" class="nav-link" data-scroll-target="#advanced-vector-operations"><span class="header-section-number">7.4</span> Advanced Vector Operations</a>
|
<li><a href="#advanced-vector-operations" id="toc-advanced-vector-operations" class="nav-link" data-scroll-target="#advanced-vector-operations">Advanced Vector Operations</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#visualizing-feature-collections" id="toc-visualizing-feature-collections" class="nav-link" data-scroll-target="#visualizing-feature-collections"><span class="header-section-number">7.4.1</span> Visualizing Feature Collections</a></li>
|
<li><a href="#visualizing-feature-collections" id="toc-visualizing-feature-collections" class="nav-link" data-scroll-target="#visualizing-feature-collections">Visualizing Feature Collections</a></li>
|
||||||
<li><a href="#joins-with-feature-collections" id="toc-joins-with-feature-collections" class="nav-link" data-scroll-target="#joins-with-feature-collections"><span class="header-section-number">7.4.2</span> Joins with Feature Collections</a></li>
|
<li><a href="#joins-with-feature-collections" id="toc-joins-with-feature-collections" class="nav-link" data-scroll-target="#joins-with-feature-collections">Joins with Feature Collections</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="#conclusion-3" id="toc-conclusion-3" class="nav-link" data-scroll-target="#conclusion-3">Conclusion</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -343,7 +331,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></h1>
|
<h1 class="title"><span class="chapter-title">Vectors and Tables</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -359,8 +347,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<p>In addition to raster data processing, Earth Engine supports a rich set of vector processing tools. This Part introduces you to the vector framework in Earth Engine, shows you how to create and to import your vector data, and how to combine vector and raster data for analyses.</p>
|
<p>In addition to raster data processing, Earth Engine supports a rich set of vector processing tools. This Part introduces you to the vector framework in Earth Engine, shows you how to create and to import your vector data, and how to combine vector and raster data for analyses.</p>
|
||||||
<section id="exploring-vectors" class="level2" data-number="7.1">
|
<section id="exploring-vectors" class="level2">
|
||||||
<h2 data-number="7.1" class="anchored" data-anchor-id="exploring-vectors"><span class="header-section-number">7.1</span> Exploring Vectors</h2>
|
<h2 class="anchored" data-anchor-id="exploring-vectors">Exploring Vectors</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -408,13 +396,13 @@ Chapter Information
|
|||||||
<p>As you have seen, raster features in Earth Engine are stored as an Image or as part of an ImageCollection. Using a similar conceptual model, vector data in Earth Engine is stored as a Feature or as part of a FeatureCollection. Features and feature collections provide useful data to filter images and image collections by their location, clip images to a boundary, or statistically summarize the pixel values within a region.</p>
|
<p>As you have seen, raster features in Earth Engine are stored as an Image or as part of an ImageCollection. Using a similar conceptual model, vector data in Earth Engine is stored as a Feature or as part of a FeatureCollection. Features and feature collections provide useful data to filter images and image collections by their location, clip images to a boundary, or statistically summarize the pixel values within a region.</p>
|
||||||
<p>In the following example, you will use features and feature collections to identify which city block near the University of San Francisco (USF) campus is the most green.</p>
|
<p>In the following example, you will use features and feature collections to identify which city block near the University of San Francisco (USF) campus is the most green.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="using-geometry-tools-to-create-features-in-earth-engine" class="level3" data-number="7.1.1">
|
<section id="using-geometry-tools-to-create-features-in-earth-engine" class="level3">
|
||||||
<h3 data-number="7.1.1" class="anchored" data-anchor-id="using-geometry-tools-to-create-features-in-earth-engine"><span class="header-section-number">7.1.1</span> Using Geometry Tools to Create Features in Earth Engine</h3>
|
<h3 class="anchored" data-anchor-id="using-geometry-tools-to-create-features-in-earth-engine">Using Geometry Tools to Create Features in Earth Engine</h3>
|
||||||
<p>To demonstrate how geometry tools in Earth Engine work, let’s start by creating a point, and two polygons to represent different elements on the USF campus.</p>
|
<p>To demonstrate how geometry tools in Earth Engine work, let’s start by creating a point, and two polygons to represent different elements on the USF campus.</p>
|
||||||
<p>Click on the geometry tools in the top left of the Map pane and create a point feature. Place a new point where USF is located (see Fig. F5.0.1).</p>
|
<p>Click on the geometry tools in the top left of the Map pane and create a point feature. Place a new point where USF is located (see Fig. F5.0.1).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image54.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image54.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.1 Location of the USF campus in San Francisco, California. Your first point should be in this vicinity. The red arrow points to the geometry tools.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.1 Location of the USF campus in San Francisco, California. Your first point should be in this vicinity. The red arrow points to the geometry tools.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -423,7 +411,7 @@ Chapter Information
|
|||||||
<p>After you create these layers, rename the geometry imports at the top of your script. Name the layers usf_point, usf_building, and usf_campus. These names are used within the script shown in Fig. F5.0.2.</p>
|
<p>After you create these layers, rename the geometry imports at the top of your script. Name the layers usf_point, usf_building, and usf_campus. These names are used within the script shown in Fig. F5.0.2.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image10.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image10.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.2 Rename the default variable names for each layer in the Imports section of the code at the top of your script</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.2 Rename the default variable names for each layer in the Imports section of the code at the top of your script</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -441,8 +429,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="loading-existing-features-and-feature-collections-in-earth-engine" class="level3" data-number="7.1.2">
|
<section id="loading-existing-features-and-feature-collections-in-earth-engine" class="level3">
|
||||||
<h3 data-number="7.1.2" class="anchored" data-anchor-id="loading-existing-features-and-feature-collections-in-earth-engine"><span class="header-section-number">7.1.2</span> Loading Existing Features and Feature Collections in Earth Engine</h3>
|
<h3 class="anchored" data-anchor-id="loading-existing-features-and-feature-collections-in-earth-engine">Loading Existing Features and Feature Collections in Earth Engine</h3>
|
||||||
<p>If you wish to have the exact same geometry imports in this chapter for the rest of this exercise, begin this section using the code at the Code Checkpoint above.</p>
|
<p>If you wish to have the exact same geometry imports in this chapter for the rest of this exercise, begin this section using the code at the Code Checkpoint above.</p>
|
||||||
<p>Next, you will load a city block dataset to determine the amount of vegetation on blocks near USF. The code below imports an existing feature dataset in Earth Engine. The Topologically Integrated Geographic Encoding and Referencing (TIGER) boundaries are census-designated boundaries that are a useful resource when comparing socioeconomic and diversity metrics with environmental datasets in the United States.</p>
|
<p>Next, you will load a city block dataset to determine the amount of vegetation on blocks near USF. The code below imports an existing feature dataset in Earth Engine. The Topologically Integrated Geographic Encoding and Referencing (TIGER) boundaries are census-designated boundaries that are a useful resource when comparing socioeconomic and diversity metrics with environmental datasets in the United States.</p>
|
||||||
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the Census Tiger Boundaries from GEE. </span></span>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the Census Tiger Boundaries from GEE. </span></span>
|
||||||
@@ -452,37 +440,37 @@ Note
|
|||||||
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(tiger<span class="op">,</span> { <span class="st">'color'</span><span class="op">:</span> <span class="st">'black'</span>}<span class="op">,</span> <span class="st">'Tiger'</span><span class="op">,</span> <span class="kw">false</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(tiger<span class="op">,</span> { <span class="st">'color'</span><span class="op">:</span> <span class="st">'black'</span>}<span class="op">,</span> <span class="st">'Tiger'</span><span class="op">,</span> <span class="kw">false</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>You should now have the geometry for USF’s campus and a layer added to your map that is not visualized for census blocks across the United States. Next, we will use neighborhood data to spatially filter the TIGER feature collection for blocks near USF’s campus.</p>
|
<p>You should now have the geometry for USF’s campus and a layer added to your map that is not visualized for census blocks across the United States. Next, we will use neighborhood data to spatially filter the TIGER feature collection for blocks near USF’s campus.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="importing-features-into-earth-engine" class="level3" data-number="7.1.3">
|
<section id="importing-features-into-earth-engine" class="level3">
|
||||||
<h3 data-number="7.1.3" class="anchored" data-anchor-id="importing-features-into-earth-engine"><span class="header-section-number">7.1.3</span> Importing Features into Earth Engine</h3>
|
<h3 class="anchored" data-anchor-id="importing-features-into-earth-engine">Importing Features into Earth Engine</h3>
|
||||||
<p>There are many image collections loaded in Earth Engine, and they can cover a very large area that you might want to study. Borders can be quite intricate (for example, a detailed coastline), and fortunately there is no need for you to digitize the intricate boundary of a large geographic area. Instead, we will show how to find a spatial dataset online, download the data, and load this into Earth Engine as an asset for use.</p>
|
<p>There are many image collections loaded in Earth Engine, and they can cover a very large area that you might want to study. Borders can be quite intricate (for example, a detailed coastline), and fortunately there is no need for you to digitize the intricate boundary of a large geographic area. Instead, we will show how to find a spatial dataset online, download the data, and load this into Earth Engine as an asset for use.</p>
|
||||||
<section id="find-a-spatial-dataset-of-san-francisco-neighborhoods" class="level4" data-number="7.1.3.1">
|
<section id="find-a-spatial-dataset-of-san-francisco-neighborhoods" class="level4">
|
||||||
<h4 data-number="7.1.3.1" class="anchored" data-anchor-id="find-a-spatial-dataset-of-san-francisco-neighborhoods"><span class="header-section-number">7.1.3.1</span> Find a Spatial Dataset of San Francisco Neighborhoods</h4>
|
<h4 class="anchored" data-anchor-id="find-a-spatial-dataset-of-san-francisco-neighborhoods">Find a Spatial Dataset of San Francisco Neighborhoods</h4>
|
||||||
<p>Use your internet searching skills to locate the “Analysis Neighborhoods” dataset covering San Francisco. This data might be located in a number of places, including DataSF, the City of San Francisco’s public-facing data repository.</p>
|
<p>Use your internet searching skills to locate the “Analysis Neighborhoods” dataset covering San Francisco. This data might be located in a number of places, including DataSF, the City of San Francisco’s public-facing data repository.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image27.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image27.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.3 DataSF website neighborhood shapefile to download</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.3 DataSF website neighborhood shapefile to download</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>After you find the Analysis Neighborhoods layer, click Export and select Shapefile (Fig. F5.0.3). Keep track of where you save the zipped file, as we will load this into Earth Engine. Shapefiles contain vector-based data—points, lines, polygons—and include a number of files, such as the location information, attribute information, and others.</p>
|
<p>After you find the Analysis Neighborhoods layer, click Export and select Shapefile (Fig. F5.0.3). Keep track of where you save the zipped file, as we will load this into Earth Engine. Shapefiles contain vector-based data—points, lines, polygons—and include a number of files, such as the location information, attribute information, and others.</p>
|
||||||
<p>Extract the folder to your computer. When you open the folder, you will see that there are actually many files. The extensions (.shp, .dbf, .shx, .prj) all provide a different piece of information to display vector-based data. The .shp file provides data on the geometry. The .dbf file provides data about the attributes. The .shx file is an index file. Lastly, the .prj file describes the map projection of the coordinate information for the shapefile. You will need to load all four files to create a new feature asset in Earth Engine.</p>
|
<p>Extract the folder to your computer. When you open the folder, you will see that there are actually many files. The extensions (.shp, .dbf, .shx, .prj) all provide a different piece of information to display vector-based data. The .shp file provides data on the geometry. The .dbf file provides data about the attributes. The .shx file is an index file. Lastly, the .prj file describes the map projection of the coordinate information for the shapefile. You will need to load all four files to create a new feature asset in Earth Engine.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="upload-sf-neighborhoods-file-as-an-asset" class="level4" data-number="7.1.3.2">
|
<section id="upload-sf-neighborhoods-file-as-an-asset" class="level4">
|
||||||
<h4 data-number="7.1.3.2" class="anchored" data-anchor-id="upload-sf-neighborhoods-file-as-an-asset"><span class="header-section-number">7.1.3.2</span> Upload SF Neighborhoods File as an Asset</h4>
|
<h4 class="anchored" data-anchor-id="upload-sf-neighborhoods-file-as-an-asset">Upload SF Neighborhoods File as an Asset</h4>
|
||||||
<p>Navigate to the Assets tab (near Scripts). Select New > Table Upload > Shape files (Fig. F5.0.4).</p>
|
<p>Navigate to the Assets tab (near Scripts). Select New > Table Upload > Shape files (Fig. F5.0.4).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image52.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image52.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.4 Import an asset as a zipped folder</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.4 Import an asset as a zipped folder</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="select-files-and-name-asset" class="level4" data-number="7.1.3.3">
|
<section id="select-files-and-name-asset" class="level4">
|
||||||
<h4 data-number="7.1.3.3" class="anchored" data-anchor-id="select-files-and-name-asset"><span class="header-section-number">7.1.3.3</span> Select Files and Name Asset</h4>
|
<h4 class="anchored" data-anchor-id="select-files-and-name-asset">Select Files and Name Asset</h4>
|
||||||
<p>Click the Select button and then use the file navigator to select the component files of the shapefile structure (i.e., .shp, .dbf, .shx, and .prj) (Fig. F5.0.5). Assign an Asset Name so you can recognize this asset.</p>
|
<p>Click the Select button and then use the file navigator to select the component files of the shapefile structure (i.e., .shp, .dbf, .shx, and .prj) (Fig. F5.0.5). Assign an Asset Name so you can recognize this asset.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image43.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image43.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.5 Select the four files extracted from the zipped folder. Make sure each file has the same name and that there are no spaces in the file names of the component files of the shapefile structure.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.5 Select the four files extracted from the zipped folder. Make sure each file has the same name and that there are no spaces in the file names of the component files of the shapefile structure.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -511,10 +499,10 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="filtering-feature-collections-by-attributes" class="level3" data-number="7.1.4">
|
<section id="filtering-feature-collections-by-attributes" class="level3">
|
||||||
<h3 data-number="7.1.4" class="anchored" data-anchor-id="filtering-feature-collections-by-attributes"><span class="header-section-number">7.1.4</span> Filtering Feature Collections by Attributes</h3>
|
<h3 class="anchored" data-anchor-id="filtering-feature-collections-by-attributes">Filtering Feature Collections by Attributes</h3>
|
||||||
<section id="filter-by-geometry-of-another-feature" class="level4" data-number="7.1.4.1">
|
<section id="filter-by-geometry-of-another-feature" class="level4">
|
||||||
<h4 data-number="7.1.4.1" class="anchored" data-anchor-id="filter-by-geometry-of-another-feature"><span class="header-section-number">7.1.4.1</span> Filter by Geometry of Another Feature</h4>
|
<h4 class="anchored" data-anchor-id="filter-by-geometry-of-another-feature">Filter by Geometry of Another Feature</h4>
|
||||||
<p>First, let’s find the neighborhood associated with USF. Use the first point you created to find the neighborhood that intersects this point; filterBounds is the tool that does that, returning a filtered feature.</p>
|
<p>First, let’s find the neighborhood associated with USF. Use the first point you created to find the neighborhood that intersects this point; filterBounds is the tool that does that, returning a filtered feature.</p>
|
||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Filter sfNeighborhoods by USF. </span></span>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Filter sfNeighborhoods by USF. </span></span>
|
||||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> usfNeighborhood <span class="op">=</span> sfNeighborhoods<span class="op">.</span><span class="fu">filterBounds</span>(usf_point)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> usfNeighborhood <span class="op">=</span> sfNeighborhoods<span class="op">.</span><span class="fu">filterBounds</span>(usf_point)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
@@ -523,8 +511,8 @@ Note
|
|||||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> usfTiger <span class="op">=</span> tiger<span class="op">.</span><span class="fu">filterBounds</span>(usfNeighborhood)<span class="op">;</span> </span>
|
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> usfTiger <span class="op">=</span> tiger<span class="op">.</span><span class="fu">filterBounds</span>(usfNeighborhood)<span class="op">;</span> </span>
|
||||||
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(usfTiger<span class="op">,</span> {}<span class="op">,</span> <span class="st">'usf_Tiger'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(usfTiger<span class="op">,</span> {}<span class="op">,</span> <span class="st">'usf_Tiger'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
<section id="filter-by-feature-attribute-properties" class="level4" data-number="7.1.4.2">
|
<section id="filter-by-feature-attribute-properties" class="level4">
|
||||||
<h4 data-number="7.1.4.2" class="anchored" data-anchor-id="filter-by-feature-attribute-properties"><span class="header-section-number">7.1.4.2</span> Filter by Feature (Attribute) Properties</h4>
|
<h4 class="anchored" data-anchor-id="filter-by-feature-attribute-properties">Filter by Feature (Attribute) Properties</h4>
|
||||||
<p>In addition to filtering a FeatureCollection by the location of another feature, you can also filter it by its properties. First, let’s print the usfTiger variable to the Console and inspect the object.</p>
|
<p>In addition to filtering a FeatureCollection by the location of another feature, you can also filter it by its properties. First, let’s print the usfTiger variable to the Console and inspect the object.</p>
|
||||||
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(usfTiger)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(usfTiger)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>You can click on the feature collection name in the Console to uncover more information about the dataset. Click on the columns to learn about what attribute information is contained in this dataset. You will notice this feature collection contains information on both housing (‘housing10’) and population (‘pop10’).</p>
|
<p>You can click on the feature collection name in the Console to uncover more information about the dataset. Click on the columns to learn about what attribute information is contained in this dataset. You will notice this feature collection contains information on both housing (‘housing10’) and population (‘pop10’).</p>
|
||||||
@@ -539,8 +527,8 @@ Note
|
|||||||
<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="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(housing10_g50_l250<span class="op">,</span> { <span class="st">'color'</span><span class="op">:</span> <span class="st">'Magenta'</span>}<span class="op">,</span> <span class="st">'housing'</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="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="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(housing10_g50_l250<span class="op">,</span> { <span class="st">'color'</span><span class="op">:</span> <span class="st">'Magenta'</span>}<span class="op">,</span> <span class="st">'housing'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>We have combined spatial and attribute information to narrow the set to only those blocks that meet our criteria of having between 50 and 250 housing units.</p>
|
<p>We have combined spatial and attribute information to narrow the set to only those blocks that meet our criteria of having between 50 and 250 housing units.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="print-feature-attribute-properties-to-console" class="level4" data-number="7.1.4.3">
|
<section id="print-feature-attribute-properties-to-console" class="level4">
|
||||||
<h4 data-number="7.1.4.3" class="anchored" data-anchor-id="print-feature-attribute-properties-to-console"><span class="header-section-number">7.1.4.3</span> Print Feature (Attribute) Properties to Console</h4>
|
<h4 class="anchored" data-anchor-id="print-feature-attribute-properties-to-console">Print Feature (Attribute) Properties to Console</h4>
|
||||||
<p>We can print out attribute information about these features. The block of code below prints out the area of the resultant geometry in square meters.</p>
|
<p>We can print out attribute information about these features. The block of code below prints out the area of the resultant geometry in square meters.</p>
|
||||||
<div class="sourceCode" id="cb9"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> housing_area <span class="op">=</span> housing10_g50_l250<span class="op">.</span><span class="fu">geometry</span>()<span class="op">.</span><span class="fu">area</span>()<span class="op">;</span> </span>
|
<div class="sourceCode" id="cb9"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> housing_area <span class="op">=</span> housing10_g50_l250<span class="op">.</span><span class="fu">geometry</span>()<span class="op">.</span><span class="fu">area</span>()<span class="op">;</span> </span>
|
||||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'housing_area:'</span><span class="op">,</span> housing_area)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'housing_area:'</span><span class="op">,</span> housing_area)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
@@ -567,12 +555,12 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="reducing-images-using-feature-geometry" class="level3" data-number="7.1.5">
|
<section id="reducing-images-using-feature-geometry" class="level3">
|
||||||
<h3 data-number="7.1.5" class="anchored" data-anchor-id="reducing-images-using-feature-geometry"><span class="header-section-number">7.1.5</span> Reducing Images Using Feature Geometry</h3>
|
<h3 class="anchored" data-anchor-id="reducing-images-using-feature-geometry">Reducing Images Using Feature Geometry</h3>
|
||||||
<p>Now that we have identified the blocks around USF’s campus that have the right housing density, let’s find which blocks are the greenest.</p>
|
<p>Now that we have identified the blocks around USF’s campus that have the right housing density, let’s find which blocks are the greenest.</p>
|
||||||
<p>The Normalized Difference Vegetation Index (NDVI), presented in detail in Chap. F2.0, is often used to compare the greenness of pixels in different locations. Values on land range from 0 to 1, with values closer to 1 representing healthier and greener vegetation than values near 0.</p>
|
<p>The Normalized Difference Vegetation Index (NDVI), presented in detail in Chap. F2.0, is often used to compare the greenness of pixels in different locations. Values on land range from 0 to 1, with values closer to 1 representing healthier and greener vegetation than values near 0.</p>
|
||||||
<section id="create-an-ndvi-image" class="level4" data-number="7.1.5.1">
|
<section id="create-an-ndvi-image" class="level4">
|
||||||
<h4 data-number="7.1.5.1" class="anchored" data-anchor-id="create-an-ndvi-image"><span class="header-section-number">7.1.5.1</span> Create an NDVI Image</h4>
|
<h4 class="anchored" data-anchor-id="create-an-ndvi-image">Create an NDVI Image</h4>
|
||||||
<p>The code below imports the Landsat 8 ImageCollection as landsat8. Then, the code filters for images in 2021. Lastly, the code sorts the images from 2021 to find the least cloudy day.</p>
|
<p>The code below imports the Landsat 8 ImageCollection as landsat8. Then, the code filters for images in 2021. Lastly, the code sorts the images from 2021 to find the least cloudy day.</p>
|
||||||
<div class="sourceCode" id="cb11"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the Landsat 8 TOA image collection. </span></span>
|
<div class="sourceCode" id="cb11"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Import the Landsat 8 TOA image collection. </span></span>
|
||||||
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> landsat8 <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'LANDSAT/LC08/C02/T1_TOA'</span>)<span class="op">;</span> </span>
|
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> landsat8 <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'LANDSAT/LC08/C02/T1_TOA'</span>)<span class="op">;</span> </span>
|
||||||
@@ -589,8 +577,8 @@ Note
|
|||||||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> red <span class="op">=</span> image<span class="op">.</span><span class="fu">select</span>(<span class="st">'B4'</span>)<span class="op">;</span> </span>
|
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> red <span class="op">=</span> image<span class="op">.</span><span class="fu">select</span>(<span class="st">'B4'</span>)<span class="op">;</span> </span>
|
||||||
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndvi <span class="op">=</span> nir<span class="op">.</span><span class="fu">subtract</span>(red)<span class="op">.</span><span class="fu">divide</span>(nir<span class="op">.</span><span class="fu">add</span>(red))<span class="op">.</span><span class="fu">rename</span>(<span class="st">'NDVI'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndvi <span class="op">=</span> nir<span class="op">.</span><span class="fu">subtract</span>(red)<span class="op">.</span><span class="fu">divide</span>(nir<span class="op">.</span><span class="fu">add</span>(red))<span class="op">.</span><span class="fu">rename</span>(<span class="st">'NDVI'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
<section id="clip-the-ndvi-image-to-the-blocks-near-usf" class="level4" data-number="7.1.5.2">
|
<section id="clip-the-ndvi-image-to-the-blocks-near-usf" class="level4">
|
||||||
<h4 data-number="7.1.5.2" class="anchored" data-anchor-id="clip-the-ndvi-image-to-the-blocks-near-usf"><span class="header-section-number">7.1.5.2</span> Clip the NDVI Image to the Blocks Near USF</h4>
|
<h4 class="anchored" data-anchor-id="clip-the-ndvi-image-to-the-blocks-near-usf">Clip the NDVI Image to the Blocks Near USF</h4>
|
||||||
<p>Next, you will clip the NDVI layer to only show NDVI over USF’s neighborhood.</p>
|
<p>Next, you will clip the NDVI layer to only show NDVI over USF’s neighborhood.</p>
|
||||||
<p>The first section of code provides visualization settings.</p>
|
<p>The first section of code provides visualization settings.</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="kw">var</span> ndviParams <span class="op">=</span> { </span>
|
<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="kw">var</span> ndviParams <span class="op">=</span> { </span>
|
||||||
@@ -604,8 +592,8 @@ Note
|
|||||||
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">centerObject</span>(usf_point<span class="op">,</span> <span class="dv">14</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">centerObject</span>(usf_point<span class="op">,</span> <span class="dv">14</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>The NDVI map for all of San Francisco is interesting, and shows variability across the region. Now, let’s compute mean NDVI values for each block of the city.</p>
|
<p>The NDVI map for all of San Francisco is interesting, and shows variability across the region. Now, let’s compute mean NDVI values for each block of the city.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="compute-ndvi-statistics-by-block" class="level4" data-number="7.1.5.3">
|
<section id="compute-ndvi-statistics-by-block" class="level4">
|
||||||
<h4 data-number="7.1.5.3" class="anchored" data-anchor-id="compute-ndvi-statistics-by-block"><span class="header-section-number">7.1.5.3</span> Compute NDVI Statistics by Block</h4>
|
<h4 class="anchored" data-anchor-id="compute-ndvi-statistics-by-block">Compute NDVI Statistics by Block</h4>
|
||||||
<p>The code below uses the clipped image ndviUSFblocks and computes the mean NDVI value within each boundary. The scale provides a spatial resolution for the mean values to be computed on.</p>
|
<p>The code below uses the clipped image ndviUSFblocks and computes the mean NDVI value within each boundary. The scale provides a spatial resolution for the mean values to be computed on.</p>
|
||||||
<div class="sourceCode" id="cb15"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Reduce image by feature to compute a statistic e.g. mean, max, min etc. </span></span>
|
<div class="sourceCode" id="cb15"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Reduce image by feature to compute a statistic e.g. mean, max, min etc. </span></span>
|
||||||
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndviPerBlock <span class="op">=</span> ndviUSFblocks<span class="op">.</span><span class="fu">reduceRegions</span>({ </span>
|
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ndviPerBlock <span class="op">=</span> ndviUSFblocks<span class="op">.</span><span class="fu">reduceRegions</span>({ </span>
|
||||||
@@ -615,8 +603,8 @@ Note
|
|||||||
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb15-6"><a href="#cb15-6" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>Now we’ll use Earth Engine to find out which block is greenest.</p>
|
<p>Now we’ll use Earth Engine to find out which block is greenest.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="export-table-of-ndvi-data-by-block-from-earth-engine-to-google-drive" class="level4" data-number="7.1.5.4">
|
<section id="export-table-of-ndvi-data-by-block-from-earth-engine-to-google-drive" class="level4">
|
||||||
<h4 data-number="7.1.5.4" class="anchored" data-anchor-id="export-table-of-ndvi-data-by-block-from-earth-engine-to-google-drive"><span class="header-section-number">7.1.5.4</span> Export Table of NDVI Data by Block from Earth Engine to Google Drive</h4>
|
<h4 class="anchored" data-anchor-id="export-table-of-ndvi-data-by-block-from-earth-engine-to-google-drive">Export Table of NDVI Data by Block from Earth Engine to Google Drive</h4>
|
||||||
<p>Just as we loaded a feature into Earth Engine, we can export information from Earth Engine. Here, we will export the NDVI data, summarized by block, from Earth Engine to a Google Drive space so that we can interpret it in a program like Google Sheets or Excel.</p>
|
<p>Just as we loaded a feature into Earth Engine, we can export information from Earth Engine. Here, we will export the NDVI data, summarized by block, from Earth Engine to a Google Drive space so that we can interpret it in a program like Google Sheets or Excel.</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="co">// Get a table of data out of Google Earth Engine. </span></span>
|
<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="co">// Get a table of data out of Google Earth Engine. </span></span>
|
||||||
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a>Export<span class="op">.</span><span class="at">table</span><span class="op">.</span><span class="fu">toDrive</span>({ </span>
|
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a>Export<span class="op">.</span><span class="at">table</span><span class="op">.</span><span class="fu">toDrive</span>({ </span>
|
||||||
@@ -626,7 +614,7 @@ Note
|
|||||||
<p>When you run this code, you will notice that you have the Tasks tab highlighted on the top right of the Earth Engine Code Editor (Fig. F5.0.6). You will be prompted to name the directory when exporting the data.</p>
|
<p>When you run this code, you will notice that you have the Tasks tab highlighted on the top right of the Earth Engine Code Editor (Fig. F5.0.6). You will be prompted to name the directory when exporting the data.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image4.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image4.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.0.6 Under the Tasks tab, select Run to initiate download</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.0.6 Under the Tasks tab, select Run to initiate download</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -646,8 +634,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" class="level3" data-number="7.1.6">
|
<section id="identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi" class="level3">
|
||||||
<h3 data-number="7.1.6" class="anchored" data-anchor-id="identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi"><span class="header-section-number">7.1.6</span> Identifying the Block in the Neighborhood Surrounding USF with the Highest NDVI</h3>
|
<h3 class="anchored" data-anchor-id="identifying-the-block-in-the-neighborhood-surrounding-usf-with-the-highest-ndvi">Identifying the Block in the Neighborhood Surrounding USF with the Highest NDVI</h3>
|
||||||
<p>You are already familiar with filtering datasets by their attributes. Now you will sort a table and select the first element of the table.</p>
|
<p>You are already familiar with filtering datasets by their attributes. Now you will sort a table and select the first element of the table.</p>
|
||||||
<div class="sourceCode" id="cb17"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>ndviPerBlock <span class="op">=</span> ndviPerBlock<span class="op">.</span><span class="fu">select</span>([<span class="st">'blockid10'</span><span class="op">,</span> <span class="st">'mean'</span>])<span class="op">;</span> </span>
|
<div class="sourceCode" id="cb17"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a>ndviPerBlock <span class="op">=</span> ndviPerBlock<span class="op">.</span><span class="fu">select</span>([<span class="st">'blockid10'</span><span class="op">,</span> <span class="st">'mean'</span>])<span class="op">;</span> </span>
|
||||||
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'ndviPerBlock'</span><span class="op">,</span> ndviPerBlock)<span class="op">;</span> </span>
|
<span id="cb17-2"><a href="#cb17-2" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'ndviPerBlock'</span><span class="op">,</span> ndviPerBlock)<span class="op">;</span> </span>
|
||||||
@@ -682,8 +670,8 @@ Note
|
|||||||
<p>In this chapter, you learned how to import features into Earth Engine. In Sect. 1, you created new features using the geometry tools and loaded a feature from Earth Engine’s Data Catalog. In Sect. 2, you loaded a shapefile to an Earth Engine asset. In Sect. 3, you filtered feature collections based on their properties and locations. Finally, in Sects. 4 and 5, you used a feature collection to reduce an image, then exported the data from Earth Engine. Now you have all the tools you need to load, filter, and apply features to extract meaningful information from images using vector features in Earth Engine.</p>
|
<p>In this chapter, you learned how to import features into Earth Engine. In Sect. 1, you created new features using the geometry tools and loaded a feature from Earth Engine’s Data Catalog. In Sect. 2, you loaded a shapefile to an Earth Engine asset. In Sect. 3, you filtered feature collections based on their properties and locations. Finally, in Sects. 4 and 5, you used a feature collection to reduce an image, then exported the data from Earth Engine. Now you have all the tools you need to load, filter, and apply features to extract meaningful information from images using vector features in Earth Engine.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="rastervector-conversions" class="level2" data-number="7.2">
|
<section id="rastervector-conversions" class="level2">
|
||||||
<h2 data-number="7.2" class="anchored" data-anchor-id="rastervector-conversions"><span class="header-section-number">7.2</span> Raster/Vector Conversions</h2>
|
<h2 class="anchored" data-anchor-id="rastervector-conversions">Raster/Vector Conversions</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -731,10 +719,10 @@ Chapter Information
|
|||||||
<p>Raster and vector data are commonly combined (e.g., extracting image information for a given location or clipping an image to an area of interest); however, there are also situations in which conversion between the two formats is useful. In making such conversions, it is important to consider the key advantages of each format. Rasters can store data efficiently where each pixel has a numerical value, while vector data can more effectively represent geometric features where homogenous areas have shared properties. Each format lends itself to distinctive analytical operations, and combining them can be powerful.</p>
|
<p>Raster and vector data are commonly combined (e.g., extracting image information for a given location or clipping an image to an area of interest); however, there are also situations in which conversion between the two formats is useful. In making such conversions, it is important to consider the key advantages of each format. Rasters can store data efficiently where each pixel has a numerical value, while vector data can more effectively represent geometric features where homogenous areas have shared properties. Each format lends itself to distinctive analytical operations, and combining them can be powerful.</p>
|
||||||
<p>In this exercise, we’ll use topographic elevation and forest change images in Colombia as well as a protected area feature collection to practice the conversion between raster and vector formats, and to identify situations in which this is worthwhile.</p>
|
<p>In this exercise, we’ll use topographic elevation and forest change images in Colombia as well as a protected area feature collection to practice the conversion between raster and vector formats, and to identify situations in which this is worthwhile.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="raster-to-vector-conversion" class="level3" data-number="7.2.1">
|
<section id="raster-to-vector-conversion" class="level3">
|
||||||
<h3 data-number="7.2.1" class="anchored" data-anchor-id="raster-to-vector-conversion"><span class="header-section-number">7.2.1</span> Raster to Vector Conversion</h3>
|
<h3 class="anchored" data-anchor-id="raster-to-vector-conversion">Raster to Vector Conversion</h3>
|
||||||
<section id="raster-to-polygons" class="level4" data-number="7.2.1.1">
|
<section id="raster-to-polygons" class="level4">
|
||||||
<h4 data-number="7.2.1.1" class="anchored" data-anchor-id="raster-to-polygons"><span class="header-section-number">7.2.1.1</span> Raster to Polygons</h4>
|
<h4 class="anchored" data-anchor-id="raster-to-polygons">Raster to Polygons</h4>
|
||||||
<p>In this section we will convert an elevation image (raster) to a feature collection (vector). We will start by loading the Global Multi-Resolution Terrain Elevation Data 2010 and the Global Administrative Unit Layers 2015 dataset to focus on Colombia. The elevation image is a raster at 7.5 arc-second spatial resolution containing a continuous measure of elevation in meters in each pixel.</p>
|
<p>In this section we will convert an elevation image (raster) to a feature collection (vector). We will start by loading the Global Multi-Resolution Terrain Elevation Data 2010 and the Global Administrative Unit Layers 2015 dataset to focus on Colombia. The elevation image is a raster at 7.5 arc-second spatial resolution containing a continuous measure of elevation in meters in each pixel.</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="co">// Load raster (elevation) and vector (colombia) datasets. </span></span>
|
<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="co">// Load raster (elevation) and vector (colombia) datasets. </span></span>
|
||||||
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> elevation <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(<span class="st">'USGS/GMTED2010'</span>)<span class="op">.</span><span class="fu">rename</span>(<span class="st">'elevation'</span>)<span class="op">;</span> </span>
|
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> elevation <span class="op">=</span> ee<span class="op">.</span><span class="fu">Image</span>(<span class="st">'USGS/GMTED2010'</span>)<span class="op">.</span><span class="fu">rename</span>(<span class="st">'elevation'</span>)<span class="op">;</span> </span>
|
||||||
@@ -784,12 +772,12 @@ Chapter Information
|
|||||||
<span id="cb21-19"><a href="#cb21-19" aria-hidden="true" tabindex="-1"></a> <span class="dt">strokeWidth</span><span class="op">:</span> <span class="dv">1</span> </span>
|
<span id="cb21-19"><a href="#cb21-19" aria-hidden="true" tabindex="-1"></a> <span class="dt">strokeWidth</span><span class="op">:</span> <span class="dv">1</span> </span>
|
||||||
<span id="cb21-20"><a href="#cb21-20" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
<span id="cb21-20"><a href="#cb21-20" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
||||||
<span id="cb21-21"><a href="#cb21-21" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(elevationDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Elevation zone polygon'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb21-21"><a href="#cb21-21" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(elevationDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Elevation zone polygon'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/F5/image50.png" class="img-fluid"></p>
|
<p><img src="images/F5/image50.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F5/image33.png" class="img-fluid"></p>
|
<p><img src="images/F5/image33.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F5/image36.png" class="img-fluid"></p>
|
<p><img src="images/F5/image36.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image7.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image7.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.1 Raster-based elevation (top left) and zones (top right), vectorized elevation zones overlaid on the raster (bottom-left) and vectorized elevation zones only (bottom-right)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.1 Raster-based elevation (top left) and zones (top right), vectorized elevation zones overlaid on the raster (bottom-left) and vectorized elevation zones only (bottom-right)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -822,21 +810,21 @@ Chapter Information
|
|||||||
<span id="cb22-26"><a href="#cb22-26" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
<span id="cb22-26"><a href="#cb22-26" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
||||||
<span id="cb22-27"><a href="#cb22-27" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(smoothDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Elevation zone polygon (smooth)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb22-27"><a href="#cb22-27" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(smoothDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Elevation zone polygon (smooth)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>We can see now that the polygons have more distinct shapes with many fewer small polygons in the new map (Fig. F5.1.2). It is important to note that when you use methods like focalMode (or other, similar methods such as connectedComponents and connectedPixelCount), you need to reproject according to the original image in order to display properly with zoom using the interactive Code Editor.</p>
|
<p>We can see now that the polygons have more distinct shapes with many fewer small polygons in the new map (Fig. F5.1.2). It is important to note that when you use methods like focalMode (or other, similar methods such as connectedComponents and connectedPixelCount), you need to reproject according to the original image in order to display properly with zoom using the interactive Code Editor.</p>
|
||||||
<p><img src="../images/F5/image20.png" class="img-fluid"></p>
|
<p><img src="images/F5/image20.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image37.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image37.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.2 Before (left) and after (right) applying focalMode</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.2 Before (left) and after (right) applying focalMode</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="raster-to-points" class="level4" data-number="7.2.1.2">
|
<section id="raster-to-points" class="level4">
|
||||||
<h4 data-number="7.2.1.2" class="anchored" data-anchor-id="raster-to-points"><span class="header-section-number">7.2.1.2</span> Raster to Points</h4>
|
<h4 class="anchored" data-anchor-id="raster-to-points">Raster to Points</h4>
|
||||||
<p>Lastly, we will convert a small part of this elevation image into a point vector dataset. For this exercise, we will use the same example and build on the code from the previous subsection. This might be useful when you want to use geospatial data in a tabular format in combination with other conventional datasets such as economic indicators (Fig. F5.1.3).</p>
|
<p>Lastly, we will convert a small part of this elevation image into a point vector dataset. For this exercise, we will use the same example and build on the code from the previous subsection. This might be useful when you want to use geospatial data in a tabular format in combination with other conventional datasets such as economic indicators (Fig. F5.1.3).</p>
|
||||||
<p><img src="../images/F5/image24.png" class="img-fluid"></p>
|
<p><img src="images/F5/image24.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image11.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image11.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.3 Elevation point values with latitude and longitude</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.3 Elevation point values with latitude and longitude</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -888,7 +876,7 @@ Chapter Information
|
|||||||
<span id="cb24-10"><a href="#cb24-10" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(elevationSamplesStratified<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Stratified samples'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb24-10"><a href="#cb24-10" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(elevationSamplesStratified<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Stratified samples'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image23.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image23.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.4 Stratified sampling over different elevation zones</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.4 Stratified sampling over different elevation zones</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -907,8 +895,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="a-more-complex-example" class="level3" data-number="7.2.2">
|
<section id="a-more-complex-example" class="level3">
|
||||||
<h3 data-number="7.2.2" class="anchored" data-anchor-id="a-more-complex-example"><span class="header-section-number">7.2.2</span> 3. A More Complex Example</h3>
|
<h3 class="anchored" data-anchor-id="a-more-complex-example">3. A More Complex Example</h3>
|
||||||
<p>In this section we’ll use two global datasets, one to represent raster formats and the other vectors:</p>
|
<p>In this section we’ll use two global datasets, one to represent raster formats and the other vectors:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The Global Forest Change (GFC) dataset: a raster dataset describing global tree cover and change for 2001–present.</li>
|
<li>The Global Forest Change (GFC) dataset: a raster dataset describing global tree cover and change for 2001–present.</li>
|
||||||
@@ -964,7 +952,7 @@ Note
|
|||||||
<p>This will display the boundary of the La Paya protected area and deforestation in the region (Fig. F5.1.5).</p>
|
<p>This will display the boundary of the La Paya protected area and deforestation in the region (Fig. F5.1.5).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image55.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image55.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.5 View of the La Paya protected area in the Colombian Amazon (in white), and deforestation over the period 2001–2020 (in yellows and reds, with darker colors indicating more recent changes)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.5 View of the La Paya protected area in the Colombian Amazon (in white), and deforestation over the period 2001–2020 (in yellows and reds, with darker colors indicating more recent changes)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -991,10 +979,10 @@ Note
|
|||||||
<span id="cb26-20"><a href="#cb26-20" aria-hidden="true" tabindex="-1"></a> <span class="dt">min</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span> </span>
|
<span id="cb26-20"><a href="#cb26-20" aria-hidden="true" tabindex="-1"></a> <span class="dt">min</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span> </span>
|
||||||
<span id="cb26-21"><a href="#cb26-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">20</span>}<span class="op">,</span> <span class="st">'Deforestation vector'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb26-21"><a href="#cb26-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">20</span>}<span class="op">,</span> <span class="st">'Deforestation vector'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>Fig. F5.1.6 shows a comparison of the raster versus vector representations of deforestation within the protected area.</p>
|
<p>Fig. F5.1.6 shows a comparison of the raster versus vector representations of deforestation within the protected area.</p>
|
||||||
<p><img src="../images/F5/image42.png" class="img-fluid"></p>
|
<p><img src="images/F5/image42.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image13.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image13.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.6 Raster (left) versus vector (right) representations of deforestation data of the La Paya protected area</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.6 Raster (left) versus vector (right) representations of deforestation data of the La Paya protected area</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1013,7 +1001,7 @@ Note
|
|||||||
<span id="cb27-12"><a href="#cb27-12" aria-hidden="true" tabindex="-1"></a> })<span class="op">;</span><span class="fu">print</span>(chart)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb27-12"><a href="#cb27-12" aria-hidden="true" tabindex="-1"></a> })<span class="op">;</span><span class="fu">print</span>(chart)<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image15.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image15.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.7 Plot of the number of deforestation events in La Paya for the years 2001–2020</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.7 Plot of the number of deforestation events in La Paya for the years 2001–2020</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1058,8 +1046,8 @@ Note
|
|||||||
<p>Code Checkpoint F51b. The book’s repository contains a script that shows what your code should look like at this point.</p>
|
<p>Code Checkpoint F51b. The book’s repository contains a script that shows what your code should look like at this point.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section id="raster-properties-to-vector-fields" class="level4" data-number="7.2.2.1">
|
<section id="raster-properties-to-vector-fields" class="level4">
|
||||||
<h4 data-number="7.2.2.1" class="anchored" data-anchor-id="raster-properties-to-vector-fields"><span class="header-section-number">7.2.2.1</span> Raster Properties to Vector Fields</h4>
|
<h4 class="anchored" data-anchor-id="raster-properties-to-vector-fields">Raster Properties to Vector Fields</h4>
|
||||||
<p>Sometimes we want to extract information from a raster to be included in an existing vector dataset. An example might be estimating a deforestation rate for a set of protected areas. Rather than perform this task on a case-by-case basis, we can attach information generated from an image as a property of a feature.</p>
|
<p>Sometimes we want to extract information from a raster to be included in an existing vector dataset. An example might be estimating a deforestation rate for a set of protected areas. Rather than perform this task on a case-by-case basis, we can attach information generated from an image as a property of a feature.</p>
|
||||||
<p>The following script shows how this can be used to quantify a deforestation rate for a set of protected areas in the Colombian Amazon.</p>
|
<p>The following script shows how this can be used to quantify a deforestation rate for a set of protected areas in the Colombian Amazon.</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">// Load required datasets. </span></span>
|
<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">// Load required datasets. </span></span>
|
||||||
@@ -1131,11 +1119,11 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="vector-to-raster-conversion" class="level3" data-number="7.2.3">
|
<section id="vector-to-raster-conversion" class="level3">
|
||||||
<h3 data-number="7.2.3" class="anchored" data-anchor-id="vector-to-raster-conversion"><span class="header-section-number">7.2.3</span> Vector-to-Raster Conversion</h3>
|
<h3 class="anchored" data-anchor-id="vector-to-raster-conversion">Vector-to-Raster Conversion</h3>
|
||||||
<p>In Sect. 1, we used the protected area feature collection as its original vector format. In this section, we will rasterize the protected area polygons to produce a mask and use this to assess rates of forest change.</p>
|
<p>In Sect. 1, we used the protected area feature collection as its original vector format. In this section, we will rasterize the protected area polygons to produce a mask and use this to assess rates of forest change.</p>
|
||||||
<section id="polygons-to-a-mask" class="level4" data-number="7.2.3.1">
|
<section id="polygons-to-a-mask" class="level4">
|
||||||
<h4 data-number="7.2.3.1" class="anchored" data-anchor-id="polygons-to-a-mask"><span class="header-section-number">7.2.3.1</span> Polygons to a Mask</h4>
|
<h4 class="anchored" data-anchor-id="polygons-to-a-mask">Polygons to a Mask</h4>
|
||||||
<p>The most common operation to convert from vector to raster is the production of binary image masks, describing whether a pixel intersects a line or falls within a polygon. To convert from vector to a raster mask, we can use the ee.FeatureCollection.reduceToImage method. Let’s continue with our example of the WDPA database and Global Forest Change data from the previous section:</p>
|
<p>The most common operation to convert from vector to raster is the production of binary image masks, describing whether a pixel intersects a line or falls within a polygon. To convert from vector to a raster mask, we can use the ee.FeatureCollection.reduceToImage method. Let’s continue with our example of the WDPA database and Global Forest Change data from the previous section:</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">// Load required datasets. </span></span>
|
<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">// Load required datasets. </span></span>
|
||||||
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> gfc <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>
|
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> gfc <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>
|
||||||
@@ -1196,8 +1184,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="a-more-complex-example-1" class="level4" data-number="7.2.3.2">
|
<section id="a-more-complex-example-1" class="level4">
|
||||||
<h4 data-number="7.2.3.2" class="anchored" data-anchor-id="a-more-complex-example-1"><span class="header-section-number">7.2.3.2</span> A More Complex Example</h4>
|
<h4 class="anchored" data-anchor-id="a-more-complex-example-1">A More Complex Example</h4>
|
||||||
<p>The reduceToImage method is not the only way to convert a feature collection to an image. We will create a distance image layer from the boundary of the protected area using distance. For this example, we return to the La Paya protected area explored in Sect. 1.</p>
|
<p>The reduceToImage method is not the only way to convert a feature collection to an image. We will create a distance image layer from the boundary of the protected area using distance. For this example, we return to the La Paya protected area explored in Sect. 1.</p>
|
||||||
<div class="sourceCode" id="cb35"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Load required datasets. </span></span>
|
<div class="sourceCode" id="cb35"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Load required datasets. </span></span>
|
||||||
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> gfc <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>
|
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> gfc <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>
|
||||||
@@ -1229,11 +1217,11 @@ Note
|
|||||||
<span id="cb36-10"><a href="#cb36-10" aria-hidden="true" tabindex="-1"></a><span class="op">.</span><span class="fu">not</span>())<span class="op">,</span> { </span>
|
<span id="cb36-10"><a href="#cb36-10" aria-hidden="true" tabindex="-1"></a><span class="op">.</span><span class="fu">not</span>())<span class="op">,</span> { </span>
|
||||||
<span id="cb36-11"><a href="#cb36-11" 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="cb36-11"><a href="#cb36-11" 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="cb36-12"><a href="#cb36-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">20000</span>}<span class="op">,</span> <span class="st">'Distance outside protected area'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb36-12"><a href="#cb36-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">20000</span>}<span class="op">,</span> <span class="st">'Distance outside protected area'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/F5/image56.png" class="img-fluid"></p>
|
<p><img src="images/F5/image56.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F5/image9.png" class="img-fluid"></p>
|
<p><img src="images/F5/image9.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image25.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image25.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.8 Distance from the La Paya boundary (left), distance within the La Paya (middle), and distance outside the La Paya (right)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.8 Distance from the La Paya boundary (left), distance within the La Paya (middle), and distance outside the La Paya (right)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1263,12 +1251,12 @@ Note
|
|||||||
<span id="cb37-22"><a href="#cb37-22" 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="cb37-22"><a href="#cb37-22" 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="cb37-23"><a href="#cb37-23" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span> </span>
|
<span id="cb37-23"><a href="#cb37-23" aria-hidden="true" tabindex="-1"></a> <span class="dt">max</span><span class="op">:</span> <span class="dv">1</span><span class="op">,</span> </span>
|
||||||
<span id="cb37-24"><a href="#cb37-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">opacity</span><span class="op">:</span> <span class="fl">0.5</span>}<span class="op">,</span> <span class="st">'Deforestation within a 5km buffer'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb37-24"><a href="#cb37-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">opacity</span><span class="op">:</span> <span class="fl">0.5</span>}<span class="op">,</span> <span class="st">'Deforestation within a 5km buffer'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/F5/image22.png" class="img-fluid"></p>
|
<p><img src="images/F5/image22.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F5/image6.png" class="img-fluid"></p>
|
<p><img src="images/F5/image6.png" class="img-fluid"></p>
|
||||||
<p><img src="../images/F5/image21.png" class="img-fluid"></p>
|
<p><img src="images/F5/image21.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image26.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image26.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.1.9 Distance zones (top left) and deforestation by zone (<1 km, <3 km, and <5 km)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.1.9 Distance zones (top left) and deforestation by zone (<1 km, <3 km, and <5 km)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1313,8 +1301,8 @@ Note
|
|||||||
<p>In this chapter, you learned how to convert raster to vector and vice versa. More importantly, you now have a better understanding of why and when such conversions are useful. Our examples should give you practical applications and ideas for using these techniques.</p>
|
<p>In this chapter, you learned how to convert raster to vector and vice versa. More importantly, you now have a better understanding of why and when such conversions are useful. Our examples should give you practical applications and ideas for using these techniques.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="zonal-statistics" class="level2" data-number="7.3">
|
<section id="zonal-statistics" class="level2">
|
||||||
<h2 data-number="7.3" class="anchored" data-anchor-id="zonal-statistics"><span class="header-section-number">7.3</span> Zonal Statistics</h2>
|
<h2 class="anchored" data-anchor-id="zonal-statistics">Zonal Statistics</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -1365,15 +1353,15 @@ Chapter Information
|
|||||||
<p>In fieldwork, researchers often work with plots, which are commonly recorded as polygon files or as a center point with a set radius. It is rare that plots will be set directly in the center of pixels from your desired raster dataset, and many field GPS units have positioning errors. Because of these issues, it may be important to use a statistic of adjacent pixels (as described in Chap. F3.2) to estimate the central value in what’s often called a neighborhood mean or focal mean (Cansler and McKenzie 2012, Miller and Thode 2007).</p>
|
<p>In fieldwork, researchers often work with plots, which are commonly recorded as polygon files or as a center point with a set radius. It is rare that plots will be set directly in the center of pixels from your desired raster dataset, and many field GPS units have positioning errors. Because of these issues, it may be important to use a statistic of adjacent pixels (as described in Chap. F3.2) to estimate the central value in what’s often called a neighborhood mean or focal mean (Cansler and McKenzie 2012, Miller and Thode 2007).</p>
|
||||||
<p>To choose the size of your neighborhood, you will need to consider your research questions, the spatial resolution of the dataset, the size of your field plot, and the error from your GPS. For example, the raster value extracted for randomly placed 20 m diameter plots would likely merit use of a neighborhood mean when using Sentinel-2 or Landsat 8—at 10 m and 30 m spatial resolution, respectively—while using a thermal band from MODIS (Moderate Resolution Imaging Spectroradiometer) at 1000 m may not. While much of this tutorial is written with plot points and buffers in mind, a polygon asset with predefined regions will serve the same purpose.</p>
|
<p>To choose the size of your neighborhood, you will need to consider your research questions, the spatial resolution of the dataset, the size of your field plot, and the error from your GPS. For example, the raster value extracted for randomly placed 20 m diameter plots would likely merit use of a neighborhood mean when using Sentinel-2 or Landsat 8—at 10 m and 30 m spatial resolution, respectively—while using a thermal band from MODIS (Moderate Resolution Imaging Spectroradiometer) at 1000 m may not. While much of this tutorial is written with plot points and buffers in mind, a polygon asset with predefined regions will serve the same purpose.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="functions" class="level3" data-number="7.3.1">
|
<section id="functions" class="level3">
|
||||||
<h3 data-number="7.3.1" class="anchored" data-anchor-id="functions"><span class="header-section-number">7.3.1</span> Functions</h3>
|
<h3 class="anchored" data-anchor-id="functions">Functions</h3>
|
||||||
<p>Two functions are provided; copy and paste them into your script:</p>
|
<p>Two functions are provided; copy and paste them into your script:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A function to generate circular or square regions from buffered points</li>
|
<li>A function to generate circular or square regions from buffered points</li>
|
||||||
<li>A function to extract image pixel neighborhood statistics for a given region</li>
|
<li>A function to extract image pixel neighborhood statistics for a given region</li>
|
||||||
</ul>
|
</ul>
|
||||||
<section id="function-bufferpointsradius-bounds" class="level4" data-number="7.3.1.1">
|
<section id="function-bufferpointsradius-bounds" class="level4">
|
||||||
<h4 data-number="7.3.1.1" class="anchored" data-anchor-id="function-bufferpointsradius-bounds"><span class="header-section-number">7.3.1.1</span> Function: bufferPoints(radius, bounds)</h4>
|
<h4 class="anchored" data-anchor-id="function-bufferpointsradius-bounds">Function: bufferPoints(radius, bounds)</h4>
|
||||||
<p>Our first function, bufferPoints, returns a function for adding a buffer to points and optionally transforming to rectangular bounds</p>
|
<p>Our first function, bufferPoints, returns a function for adding a buffer to points and optionally transforming to rectangular bounds</p>
|
||||||
<div class="sourceCode" id="cb39"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">bufferPoints</span>(radius<span class="op">,</span> bounds) {</span>
|
<div class="sourceCode" id="cb39"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">bufferPoints</span>(radius<span class="op">,</span> bounds) {</span>
|
||||||
<span id="cb39-2"><a href="#cb39-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="kw">function</span>(pt) {</span>
|
<span id="cb39-2"><a href="#cb39-2" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="kw">function</span>(pt) {</span>
|
||||||
@@ -1383,8 +1371,8 @@ Chapter Information
|
|||||||
<span id="cb39-6"><a href="#cb39-6" aria-hidden="true" tabindex="-1"></a> }<span class="op">;</span></span>
|
<span id="cb39-6"><a href="#cb39-6" aria-hidden="true" tabindex="-1"></a> }<span class="op">;</span></span>
|
||||||
<span id="cb39-7"><a href="#cb39-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>
|
<span id="cb39-7"><a href="#cb39-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>
|
||||||
</section>
|
</section>
|
||||||
<section id="function-zonalstatsfc-params" class="level4" data-number="7.3.1.2">
|
<section id="function-zonalstatsfc-params" class="level4">
|
||||||
<h4 data-number="7.3.1.2" class="anchored" data-anchor-id="function-zonalstatsfc-params"><span class="header-section-number">7.3.1.2</span> Function: zonalStats(fc, params)</h4>
|
<h4 class="anchored" data-anchor-id="function-zonalstatsfc-params">Function: zonalStats(fc, params)</h4>
|
||||||
<p>The second function, zonalStats, reduces images in an ImageCollection by regions defined in a FeatureCollection. Note that reductions can return null statistics that you might want to filter out of the resulting feature collection. Null statistics occur when there are no valid pixels intersecting the region being reduced. This situation can be caused by points that are outside of an image or in regions that are masked for quality or clouds.</p>
|
<p>The second function, zonalStats, reduces images in an ImageCollection by regions defined in a FeatureCollection. Note that reductions can return null statistics that you might want to filter out of the resulting feature collection. Null statistics occur when there are no valid pixels intersecting the region being reduced. This situation can be caused by points that are outside of an image or in regions that are masked for quality or clouds.</p>
|
||||||
<p>This function is written to include many optional parameters (see Table F5.2.2). Look at the function carefully and note how it is written to include defaults that make it easy to apply the basic function while allowing customization.</p>
|
<p>This function is written to include many optional parameters (see Table F5.2.2). Look at the function carefully and note how it is written to include defaults that make it easy to apply the basic function while allowing customization.</p>
|
||||||
<p>The desired datetime format. Use ISO 8601 data string standards. The datetime string is derived from the ‘system:time_start’ value of the ee.Image being reduced. Optional.</p>
|
<p>The desired datetime format. Use ISO 8601 data string standards. The datetime string is derived from the ‘system:time_start’ value of the ee.Image being reduced. Optional.</p>
|
||||||
@@ -1462,8 +1450,8 @@ Chapter Information
|
|||||||
<span id="cb40-72"><a href="#cb40-72" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb40-72"><a href="#cb40-72" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="point-collection-creation" class="level3" data-number="7.3.2">
|
<section id="point-collection-creation" class="level3">
|
||||||
<h3 data-number="7.3.2" class="anchored" data-anchor-id="point-collection-creation"><span class="header-section-number">7.3.2</span> Point Collection Creation</h3>
|
<h3 class="anchored" data-anchor-id="point-collection-creation">Point Collection Creation</h3>
|
||||||
<p>Below, we create a set of points that form the basis of the zonal statistics calculations. Note that a unique plot_id property is added to each point. A unique plot or point ID is important to include in your vector dataset for future filtering and joining.</p>
|
<p>Below, we create a set of points that form the basis of the zonal statistics calculations. Note that a unique plot_id property is added to each point. A unique plot or point ID is important to include in your vector dataset for future filtering and joining.</p>
|
||||||
<div class="sourceCode" id="cb41"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> pts <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>([</span>
|
<div class="sourceCode" id="cb41"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> pts <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>([</span>
|
||||||
<span id="cb41-2"><a href="#cb41-2" aria-hidden="true" tabindex="-1"></a> ee<span class="op">.</span><span class="fu">Feature</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">118.6010</span><span class="op">,</span> <span class="fl">37.0777</span>])<span class="op">,</span> {</span>
|
<span id="cb41-2"><a href="#cb41-2" aria-hidden="true" tabindex="-1"></a> ee<span class="op">.</span><span class="fu">Feature</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">118.6010</span><span class="op">,</span> <span class="fl">37.0777</span>])<span class="op">,</span> {</span>
|
||||||
@@ -1498,8 +1486,8 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="neighborhood-statistic-examples" class="level3" data-number="7.3.3">
|
<section id="neighborhood-statistic-examples" class="level3">
|
||||||
<h3 data-number="7.3.3" class="anchored" data-anchor-id="neighborhood-statistic-examples"><span class="header-section-number">7.3.3</span> Neighborhood Statistic Examples</h3>
|
<h3 class="anchored" data-anchor-id="neighborhood-statistic-examples">Neighborhood Statistic Examples</h3>
|
||||||
<p>The following examples demonstrate extracting raster neighborhood statistics for the following:</p>
|
<p>The following examples demonstrate extracting raster neighborhood statistics for the following:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A single raster with elevation and slope bands</li>
|
<li>A single raster with elevation and slope bands</li>
|
||||||
@@ -1507,8 +1495,8 @@ Note
|
|||||||
<li>A multiband Landsat time series</li>
|
<li>A multiband Landsat time series</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>In each example, the points created in the previous section will be buffered and then used as regions to extract zonal statistics for each image in the image collection.</p>
|
<p>In each example, the points created in the previous section will be buffered and then used as regions to extract zonal statistics for each image in the image collection.</p>
|
||||||
<section id="topographic-variables" class="level4" data-number="7.3.3.1">
|
<section id="topographic-variables" class="level4">
|
||||||
<h4 data-number="7.3.3.1" class="anchored" data-anchor-id="topographic-variables"><span class="header-section-number">7.3.3.1</span> Topographic Variables</h4>
|
<h4 class="anchored" data-anchor-id="topographic-variables">Topographic Variables</h4>
|
||||||
<p>This example demonstrates how to calculate zonal statistics for a single multiband image. This Digital Elevation Model (DEM) contains a single topographic band representing elevation.</p>
|
<p>This example demonstrates how to calculate zonal statistics for a single multiband image. This Digital Elevation Model (DEM) contains a single topographic band representing elevation.</p>
|
||||||
<p>####Buffer the Points</p>
|
<p>####Buffer the Points</p>
|
||||||
<p>Nex, we will apply a 45 m radius buffer to the points defined previously by mapping the bufferPoints function over the feature collection. The radius is set to 45 m to correspond to the 90 m pixel resolution of the DEM. In this case, circles are used instead of squares (set the second argument as false, i.e., do not use bounds).</p>
|
<p>Nex, we will apply a 45 m radius buffer to the points defined previously by mapping the bufferPoints function over the feature collection. The radius is set to 45 m to correspond to the 90 m pixel resolution of the DEM. In this case, circles are used instead of squares (set the second argument as false, i.e., do not use bounds).</p>
|
||||||
@@ -1559,13 +1547,13 @@ Note
|
|||||||
<p>The result is a copy of the buffered point feature collection with new properties added for the region reduction of each selected image band according to the given reducer. A part of the FeatureCollection is shown in Fig. F5.2.1. The data in that FeatureCollection corresponds to a table containing the information of Table F5.2.3. See Fig. F5.2.2 for a graphical representation of the points and the topographic data being summarized.</p>
|
<p>The result is a copy of the buffered point feature collection with new properties added for the region reduction of each selected image band according to the given reducer. A part of the FeatureCollection is shown in Fig. F5.2.1. The data in that FeatureCollection corresponds to a table containing the information of Table F5.2.3. See Fig. F5.2.2 for a graphical representation of the points and the topographic data being summarized.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image29.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image29.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.2.1 A part of the FeatureCollection produced by calculating the zonal statistics</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.2.1 A part of the FeatureCollection produced by calculating the zonal statistics</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image5.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image5.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.2.2 Sample points and topographic slope. Elevation and slope values for regions intersecting each buffered point are reduced and attached as properties of the points.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.2.2 Sample points and topographic slope. Elevation and slope values for regions intersecting each buffered point are reduced and attached as properties of the points.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1619,17 +1607,17 @@ Note
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
<section id="modis-time-series" class="level4" data-number="7.3.3.2">
|
<section id="modis-time-series" class="level4">
|
||||||
<h4 data-number="7.3.3.2" class="anchored" data-anchor-id="modis-time-series"><span class="header-section-number">7.3.3.2</span> MODIS Time Series</h4>
|
<h4 class="anchored" data-anchor-id="modis-time-series">MODIS Time Series</h4>
|
||||||
<p>A time series of MODIS eight-day surface reflectance composites demonstrates how to calculate zonal statistics for a multiband ImageCollection that requires no preprocessing, such as cloud masking or computation. Note that there is no built-in function for performing region reductions on ImageCollection objects. The zonalStats function that we are using for reduction is mapping the reduceRegions function over an ImageCollection.</p>
|
<p>A time series of MODIS eight-day surface reflectance composites demonstrates how to calculate zonal statistics for a multiband ImageCollection that requires no preprocessing, such as cloud masking or computation. Note that there is no built-in function for performing region reductions on ImageCollection objects. The zonalStats function that we are using for reduction is mapping the reduceRegions function over an ImageCollection.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="buffer-the-points" class="level4" data-number="7.3.3.3">
|
<section id="buffer-the-points" class="level4">
|
||||||
<h4 data-number="7.3.3.3" class="anchored" data-anchor-id="buffer-the-points"><span class="header-section-number">7.3.3.3</span> Buffer the Points</h4>
|
<h4 class="anchored" data-anchor-id="buffer-the-points">Buffer the Points</h4>
|
||||||
<p>In this example, suppose the point collection represents center points for field plots that are 100 m x 100 m, and apply a 50 m radius buffer to the points to match the size of the plot. Since we want zonal statistics for square plots, set the second argument of the bufferPoints function to true, so that the bounds of the buffered points are returned.</p>
|
<p>In this example, suppose the point collection represents center points for field plots that are 100 m x 100 m, and apply a 50 m radius buffer to the points to match the size of the plot. Since we want zonal statistics for square plots, set the second argument of the bufferPoints function to true, so that the bounds of the buffered points are returned.</p>
|
||||||
<p>var ptsModis = pts.map(bufferPoints(50, true));</p>
|
<p>var ptsModis = pts.map(bufferPoints(50, true));</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="calculate-zonal-statistic" class="level4" data-number="7.3.3.4">
|
<section id="calculate-zonal-statistic" class="level4">
|
||||||
<h4 data-number="7.3.3.4" class="anchored" data-anchor-id="calculate-zonal-statistic"><span class="header-section-number">7.3.3.4</span> Calculate Zonal Statistic</h4>
|
<h4 class="anchored" data-anchor-id="calculate-zonal-statistic">Calculate Zonal Statistic</h4>
|
||||||
<p>Import the MODIS 500 m global eight-day surface reflectance composite collection and filter the collection to include data for July, August, and September from 2015 through 2019.</p>
|
<p>Import the MODIS 500 m global eight-day surface reflectance composite collection and filter the collection to include data for July, August, and September from 2015 through 2019.</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="kw">var</span> modisCol <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'MODIS/006/MOD09A1'</span>) </span>
|
<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="kw">var</span> modisCol <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'MODIS/006/MOD09A1'</span>) </span>
|
||||||
<span id="cb45-2"><a href="#cb45-2" aria-hidden="true" tabindex="-1"></a> <span class="op">.</span><span class="fu">filterDate</span>(<span class="st">'2015-01-01'</span><span class="op">,</span> <span class="st">'2020-01-01'</span>) </span>
|
<span id="cb45-2"><a href="#cb45-2" aria-hidden="true" tabindex="-1"></a> <span class="op">.</span><span class="fu">filterDate</span>(<span class="st">'2015-01-01'</span><span class="op">,</span> <span class="st">'2020-01-01'</span>) </span>
|
||||||
@@ -1650,13 +1638,13 @@ Note
|
|||||||
<span id="cb46-13"><a href="#cb46-13" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ptsModisStats <span class="op">=</span> <span class="fu">zonalStats</span>(modisCol<span class="op">,</span> ptsModis<span class="op">,</span> params)<span class="op">;</span><span class="fu">print</span>(<span class="st">'Limited MODIS zonal stats table'</span><span class="op">,</span> ptsModisStats<span class="op">.</span><span class="fu">limit</span>(<span class="dv">50</span>))<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb46-13"><a href="#cb46-13" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> ptsModisStats <span class="op">=</span> <span class="fu">zonalStats</span>(modisCol<span class="op">,</span> ptsModis<span class="op">,</span> params)<span class="op">;</span><span class="fu">print</span>(<span class="st">'Limited MODIS zonal stats table'</span><span class="op">,</span> ptsModisStats<span class="op">.</span><span class="fu">limit</span>(<span class="dv">50</span>))<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>The result is a feature collection with a feature for all combinations of plots and images. Interpreted as a table, the result has 200 rows (5 plots times 40 images) and as many columns as there are feature properties. Feature properties include those from the plot asset and the image, and any associated non-system image properties. Note that the printed results are limited to the first 50 features for brevity.</p>
|
<p>The result is a feature collection with a feature for all combinations of plots and images. Interpreted as a table, the result has 200 rows (5 plots times 40 images) and as many columns as there are feature properties. Feature properties include those from the plot asset and the image, and any associated non-system image properties. Note that the printed results are limited to the first 50 features for brevity.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="landsat-time-series" class="level4" data-number="7.3.3.5">
|
<section id="landsat-time-series" class="level4">
|
||||||
<h4 data-number="7.3.3.5" class="anchored" data-anchor-id="landsat-time-series"><span class="header-section-number">7.3.3.5</span> Landsat Time Series</h4>
|
<h4 class="anchored" data-anchor-id="landsat-time-series">Landsat Time Series</h4>
|
||||||
<p>This example combines Landsat surface reflectance imagery across three instruments: Thematic Mapper (TM) from Landsat 5, Enhanced Thematic Mapper Plus (ETM+) from Landsat 7, and Operational Land Imager (OLI) from Landsat 8.</p>
|
<p>This example combines Landsat surface reflectance imagery across three instruments: Thematic Mapper (TM) from Landsat 5, Enhanced Thematic Mapper Plus (ETM+) from Landsat 7, and Operational Land Imager (OLI) from Landsat 8.</p>
|
||||||
<p>The following section prepares these collections so that band names are consistent and cloud masks are applied. Reflectance among corresponding bands are roughly congruent for the three sensors when using the surface reflectance product; therefore the processing steps that follow do not address inter-sensor harmonization. Review the current literature on inter-sensor harmonization practices if you’d like to apply a correction.</p>
|
<p>The following section prepares these collections so that band names are consistent and cloud masks are applied. Reflectance among corresponding bands are roughly congruent for the three sensors when using the surface reflectance product; therefore the processing steps that follow do not address inter-sensor harmonization. Review the current literature on inter-sensor harmonization practices if you’d like to apply a correction.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="prepare-the-landsat-image-collection" class="level4" data-number="7.3.3.6">
|
<section id="prepare-the-landsat-image-collection" class="level4">
|
||||||
<h4 data-number="7.3.3.6" class="anchored" data-anchor-id="prepare-the-landsat-image-collection"><span class="header-section-number">7.3.3.6</span> Prepare the Landsat Image Collection</h4>
|
<h4 class="anchored" data-anchor-id="prepare-the-landsat-image-collection">Prepare the Landsat Image Collection</h4>
|
||||||
<p>First, define the function to mask cloud and shadow pixels (See Chap. F4.3 for more detail on cloud masking).</p>
|
<p>First, define the function to mask cloud and shadow pixels (See Chap. F4.3 for more detail on cloud masking).</p>
|
||||||
<div class="sourceCode" id="cb47"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Mask clouds from images and apply scaling factors.</span></span>
|
<div class="sourceCode" id="cb47"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Mask clouds from images and apply scaling factors.</span></span>
|
||||||
<span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">maskScale</span>(img) {</span>
|
<span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">maskScale</span>(img) {</span>
|
||||||
@@ -1719,8 +1707,8 @@ Note
|
|||||||
<p>Merge the prepared sensor collections.</p>
|
<p>Merge the prepared sensor collections.</p>
|
||||||
<div class="sourceCode" id="cb51"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> landsatCol <span class="op">=</span> oliCol<span class="op">.</span><span class="fu">merge</span>(etmCol)<span class="op">.</span><span class="fu">merge</span>(tmCol)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<div class="sourceCode" id="cb51"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> landsatCol <span class="op">=</span> oliCol<span class="op">.</span><span class="fu">merge</span>(etmCol)<span class="op">.</span><span class="fu">merge</span>(tmCol)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
<section id="calculate-zonal-statistics" class="level4" data-number="7.3.3.7">
|
<section id="calculate-zonal-statistics" class="level4">
|
||||||
<h4 data-number="7.3.3.7" class="anchored" data-anchor-id="calculate-zonal-statistics"><span class="header-section-number">7.3.3.7</span> Calculate Zonal Statistics</h4>
|
<h4 class="anchored" data-anchor-id="calculate-zonal-statistics">Calculate Zonal Statistics</h4>
|
||||||
<p>Reduce each image in the collection by each plot according to the following parameters. Note that this example defines the imgProps and imgPropsRename parameters to copy over and rename just two selected image properties: Landsat image ID and the satellite that collected the data. It also uses the max reducer, which, as an unweighted reducer, will return the maximum value from pixels that have their centroid within the buffer (see Sect. 4.1 below for more details).</p>
|
<p>Reduce each image in the collection by each plot according to the following parameters. Note that this example defines the imgProps and imgPropsRename parameters to copy over and rename just two selected image properties: Landsat image ID and the satellite that collected the data. It also uses the max reducer, which, as an unweighted reducer, will return the maximum value from pixels that have their centroid within the buffer (see Sect. 4.1 below for more details).</p>
|
||||||
<div class="sourceCode" id="cb52"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define parameters for the zonalStats function. </span></span>
|
<div class="sourceCode" id="cb52"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define parameters for the zonalStats function. </span></span>
|
||||||
<span id="cb52-2"><a href="#cb52-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> params <span class="op">=</span> { </span>
|
<span id="cb52-2"><a href="#cb52-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> params <span class="op">=</span> { </span>
|
||||||
@@ -1740,8 +1728,8 @@ Note
|
|||||||
<span id="cb52-16"><a href="#cb52-16" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'Limited Landsat zonal stats table'</span><span class="op">,</span> ptsLandsatStats<span class="op">.</span><span class="fu">limit</span>(<span class="dv">50</span>))<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb52-16"><a href="#cb52-16" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(<span class="st">'Limited Landsat zonal stats table'</span><span class="op">,</span> ptsLandsatStats<span class="op">.</span><span class="fu">limit</span>(<span class="dv">50</span>))<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>The result is a feature collection with a feature for all combinations of plots and images.</p>
|
<p>The result is a feature collection with a feature for all combinations of plots and images.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="dealing-with-large-collections" class="level4" data-number="7.3.3.8">
|
<section id="dealing-with-large-collections" class="level4">
|
||||||
<h4 data-number="7.3.3.8" class="anchored" data-anchor-id="dealing-with-large-collections"><span class="header-section-number">7.3.3.8</span> Dealing with Large Collections</h4>
|
<h4 class="anchored" data-anchor-id="dealing-with-large-collections">Dealing with Large Collections</h4>
|
||||||
<p>If your browser times out, try exporting the results (as described in Chap. F6.2). It’s likely that point feature collections that cover a large area or contain many points (point-image observations) will need to be exported as a batch task by either exporting the final feature collection as an asset or as a CSV/shapefile/GeoJSON to Google Drive or GCS.</p>
|
<p>If your browser times out, try exporting the results (as described in Chap. F6.2). It’s likely that point feature collections that cover a large area or contain many points (point-image observations) will need to be exported as a batch task by either exporting the final feature collection as an asset or as a CSV/shapefile/GeoJSON to Google Drive or GCS.</p>
|
||||||
<p>Here is how you would export the above Landsat image-point feature collection to an asset and to Google Drive. Run the following code, activate the Code Editor Tasks tab, and then click the Run button. If you don’t specify your own existing folder in Drive, the folder “EEFA_outputs” will be created.</p>
|
<p>Here is how you would export the above Landsat image-point feature collection to an asset and to Google Drive. Run the following code, activate the Code Editor Tasks tab, and then click the Run button. If you don’t specify your own existing folder in Drive, the folder “EEFA_outputs” will be created.</p>
|
||||||
<div class="sourceCode" id="cb53"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a>Export<span class="op">.</span><span class="at">table</span><span class="op">.</span><span class="fu">toAsset</span>({ </span>
|
<div class="sourceCode" id="cb53"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a>Export<span class="op">.</span><span class="at">table</span><span class="op">.</span><span class="fu">toAsset</span>({ </span>
|
||||||
@@ -1770,15 +1758,15 @@ Note
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="additional-notes" class="level3" data-number="7.3.4">
|
<section id="additional-notes" class="level3">
|
||||||
<h3 data-number="7.3.4" class="anchored" data-anchor-id="additional-notes"><span class="header-section-number">7.3.4</span> Additional Notes</h3>
|
<h3 class="anchored" data-anchor-id="additional-notes">Additional Notes</h3>
|
||||||
<section id="weighted-versus-unweighted-region-reduction" class="level4" data-number="7.3.4.1">
|
<section id="weighted-versus-unweighted-region-reduction" class="level4">
|
||||||
<h4 data-number="7.3.4.1" class="anchored" data-anchor-id="weighted-versus-unweighted-region-reduction"><span class="header-section-number">7.3.4.1</span> Weighted Versus Unweighted Region Reduction</h4>
|
<h4 class="anchored" data-anchor-id="weighted-versus-unweighted-region-reduction">Weighted Versus Unweighted Region Reduction</h4>
|
||||||
<p>A region used for calculation of zonal statistics often bisects multiple pixels. Should partial pixels be included in zonal statistics? Earth Engine lets you decide by allowing you to define a reducer as either weighted or unweighted (or you can provide per-pixel weight specification as an image band). A weighted reducer will include partial pixels in the zonal statistic calculation by weighting each pixel’s contribution according to the fraction of the area intersecting the region. An unweighted reducer, on the other hand, gives equal weight to all pixels whose cell center intersects the region; all other pixels are excluded from calculation of the statistic.</p>
|
<p>A region used for calculation of zonal statistics often bisects multiple pixels. Should partial pixels be included in zonal statistics? Earth Engine lets you decide by allowing you to define a reducer as either weighted or unweighted (or you can provide per-pixel weight specification as an image band). A weighted reducer will include partial pixels in the zonal statistic calculation by weighting each pixel’s contribution according to the fraction of the area intersecting the region. An unweighted reducer, on the other hand, gives equal weight to all pixels whose cell center intersects the region; all other pixels are excluded from calculation of the statistic.</p>
|
||||||
<p>For aggregate reducers like ee.Reducer.mean and ee.Reducer.median, the default mode is weighted, while identifier reducers such as ee.Reducer.min and ee.Reducer.max are unweighted. You can adjust the behavior of weighted reducers by calling unweighted on them, as in ee.Reducer.mean.unweighted. You may also specify the weights by modifying the reducer with splitWeights; however, that is beyond the scope of this book.</p>
|
<p>For aggregate reducers like ee.Reducer.mean and ee.Reducer.median, the default mode is weighted, while identifier reducers such as ee.Reducer.min and ee.Reducer.max are unweighted. You can adjust the behavior of weighted reducers by calling unweighted on them, as in ee.Reducer.mean.unweighted. You may also specify the weights by modifying the reducer with splitWeights; however, that is beyond the scope of this book.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="copy-properties-to-computed-images" class="level4" data-number="7.3.4.2">
|
<section id="copy-properties-to-computed-images" class="level4">
|
||||||
<h4 data-number="7.3.4.2" class="anchored" data-anchor-id="copy-properties-to-computed-images"><span class="header-section-number">7.3.4.2</span> Copy Properties to Computed Images</h4>
|
<h4 class="anchored" data-anchor-id="copy-properties-to-computed-images">Copy Properties to Computed Images</h4>
|
||||||
<p>Derived, computed images do not retain the properties of their source image, so be sure to copy properties to computed images if you want them included in the region reduction table. For instance, consider the simple computation of unscaling Landsat SR data:</p>
|
<p>Derived, computed images do not retain the properties of their source image, so be sure to copy properties to computed images if you want them included in the region reduction table. For instance, consider the simple computation of unscaling Landsat SR data:</p>
|
||||||
<div class="sourceCode" id="cb54"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define a Landsat image. </span></span>
|
<div class="sourceCode" id="cb54"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define a Landsat image. </span></span>
|
||||||
<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> img <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'LANDSAT/LC08/C02/T1_L2'</span>)<span class="op">.</span><span class="fu">first</span>()<span class="op">;</span> </span>
|
<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> img <span class="op">=</span> ee<span class="op">.</span><span class="fu">ImageCollection</span>(<span class="st">'LANDSAT/LC08/C02/T1_L2'</span>)<span class="op">.</span><span class="fu">first</span>()<span class="op">;</span> </span>
|
||||||
@@ -1802,8 +1790,8 @@ Note
|
|||||||
<span id="cb55-8"><a href="#cb55-8" aria-hidden="true" tabindex="-1"></a><span class="op">.</span><span class="fu">propertyNames</span>())<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb55-8"><a href="#cb55-8" aria-hidden="true" tabindex="-1"></a><span class="op">.</span><span class="fu">propertyNames</span>())<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>Now selected properties are included. Use this technique when returning computed, derived images in a mapped function, and in single-image operations.</p>
|
<p>Now selected properties are included. Use this technique when returning computed, derived images in a mapped function, and in single-image operations.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="understanding-which-pixels-are-included-in-polygon-statistics" class="level4" data-number="7.3.4.3">
|
<section id="understanding-which-pixels-are-included-in-polygon-statistics" class="level4">
|
||||||
<h4 data-number="7.3.4.3" class="anchored" data-anchor-id="understanding-which-pixels-are-included-in-polygon-statistics"><span class="header-section-number">7.3.4.3</span> Understanding Which Pixels are Included in Polygon Statistics</h4>
|
<h4 class="anchored" data-anchor-id="understanding-which-pixels-are-included-in-polygon-statistics">Understanding Which Pixels are Included in Polygon Statistics</h4>
|
||||||
<p>If you want to visualize what pixels are included in a polygon for a region reducer, you can adapt the following code to use your own region (by replacing geometry), dataset, desired scale, and CRS parameters. The important part to note is that the image data you are adding to the map is reprojected using the same scale and CRS as that used in your region reduction (see Fig. F5.2.3).</p>
|
<p>If you want to visualize what pixels are included in a polygon for a region reducer, you can adapt the following code to use your own region (by replacing geometry), dataset, desired scale, and CRS parameters. The important part to note is that the image data you are adding to the map is reprojected using the same scale and CRS as that used in your region reduction (see Fig. F5.2.3).</p>
|
||||||
<div class="sourceCode" id="cb56"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define polygon geometry. </span></span>
|
<div class="sourceCode" id="cb56"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Define polygon geometry. </span></span>
|
||||||
<span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> geometry <span class="op">=</span> ee<span class="op">.</span><span class="at">Geometry</span><span class="op">.</span><span class="fu">Polygon</span>( </span>
|
<span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> geometry <span class="op">=</span> ee<span class="op">.</span><span class="at">Geometry</span><span class="op">.</span><span class="fu">Polygon</span>( </span>
|
||||||
@@ -1863,7 +1851,7 @@ Note
|
|||||||
<span id="cb57-36"><a href="#cb57-36" aria-hidden="true" tabindex="-1"></a> <span class="dt">color</span><span class="op">:</span> <span class="st">'purple'</span>}<span class="op">,</span> <span class="st">'Pixels in reduction'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb57-36"><a href="#cb57-36" aria-hidden="true" tabindex="-1"></a> <span class="dt">color</span><span class="op">:</span> <span class="st">'purple'</span>}<span class="op">,</span> <span class="st">'Pixels in reduction'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image44.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image44.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.2.3 Identifying pixels used in zonal statistics. By mapping the image and vector together, you can see which pixels are included in the unweighted statistic. For this example, three pixels would be included in the statistic because the polygon covers the center point of three pixels.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.2.3 Identifying pixels used in zonal statistics. By mapping the image and vector together, you can see which pixels are included in the unweighted statistic. For this example, three pixels would be included in the statistic because the polygon covers the center point of three pixels.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1899,8 +1887,8 @@ Note
|
|||||||
<p>Miller JD, Thode AE (2007) Quantifying burn severity in a heterogeneous landscape with a relative version of the delta Normalized Burn Ratio (dNBR). Remote Sens Environ 109:66–80. https://doi.org/10.1016/j.rse.2006.12.006</p>
|
<p>Miller JD, Thode AE (2007) Quantifying burn severity in a heterogeneous landscape with a relative version of the delta Normalized Burn Ratio (dNBR). Remote Sens Environ 109:66–80. https://doi.org/10.1016/j.rse.2006.12.006</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="advanced-vector-operations" class="level2" data-number="7.4">
|
<section id="advanced-vector-operations" class="level2">
|
||||||
<h2 data-number="7.4" class="anchored" data-anchor-id="advanced-vector-operations"><span class="header-section-number">7.4</span> Advanced Vector Operations</h2>
|
<h2 class="anchored" data-anchor-id="advanced-vector-operations">Advanced Vector Operations</h2>
|
||||||
<div class="callout callout-style-default callout-tip callout-titled">
|
<div class="callout callout-style-default callout-tip callout-titled">
|
||||||
<div class="callout-header d-flex align-content-center">
|
<div class="callout-header d-flex align-content-center">
|
||||||
<div class="callout-icon-container">
|
<div class="callout-icon-container">
|
||||||
@@ -1936,8 +1924,8 @@ Chapter Information
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section id="visualizing-feature-collections" class="level3" data-number="7.4.1">
|
<section id="visualizing-feature-collections" class="level3">
|
||||||
<h3 data-number="7.4.1" class="anchored" data-anchor-id="visualizing-feature-collections"><span class="header-section-number">7.4.1</span> Visualizing Feature Collections</h3>
|
<h3 class="anchored" data-anchor-id="visualizing-feature-collections">Visualizing Feature Collections</h3>
|
||||||
<p>There is a distinct difference between how rasters and vectors are visualized. While images are typically visualized based on pixel values, vector layers use feature properties (i.e., attributes) to create a visualization. Vector layers are rendered on the Map by assigning a value to the red, green, and blue channels for each pixel on the screen based on the geometry and attributes of the features. The functions used for vector data visualization in Earth Engine are listed below in increasing order of complexity.</p>
|
<p>There is a distinct difference between how rasters and vectors are visualized. While images are typically visualized based on pixel values, vector layers use feature properties (i.e., attributes) to create a visualization. Vector layers are rendered on the Map by assigning a value to the red, green, and blue channels for each pixel on the screen based on the geometry and attributes of the features. The functions used for vector data visualization in Earth Engine are listed below in increasing order of complexity.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Map.addLayer: As with raster layers, you can add a FeatureCollection to the Map by specifying visualization parameters. This method supports only one visualization parameter: color. All features are rendered with the specified color.</li>
|
<li>Map.addLayer: As with raster layers, you can add a FeatureCollection to the Map by specifying visualization parameters. This method supports only one visualization parameter: color. All features are rendered with the specified color.</li>
|
||||||
@@ -1946,8 +1934,8 @@ Chapter Information
|
|||||||
<li>style: This is the most versatile function. It can apply a different style to each feature, including color, pointSize, pointShape, width, fillColor, and lineType.</li>
|
<li>style: This is the most versatile function. It can apply a different style to each feature, including color, pointSize, pointShape, width, fillColor, and lineType.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>In the exercises below, we will learn how to use each of these functions and see how they can generate different types of maps.</p>
|
<p>In the exercises below, we will learn how to use each of these functions and see how they can generate different types of maps.</p>
|
||||||
<section id="creating-a-choropleth-map" class="level4" data-number="7.4.1.1">
|
<section id="creating-a-choropleth-map" class="level4">
|
||||||
<h4 data-number="7.4.1.1" class="anchored" data-anchor-id="creating-a-choropleth-map"><span class="header-section-number">7.4.1.1</span> Creating a Choropleth Map</h4>
|
<h4 class="anchored" data-anchor-id="creating-a-choropleth-map">Creating a Choropleth Map</h4>
|
||||||
<p>We will use the TIGER: US Census Blocks layer, which stores census block boundaries and their characteristics within the United States, along with the San Francisco neighborhoods layer from Chap. F5.0 to create a population density map for the city of San Francisco.</p>
|
<p>We will use the TIGER: US Census Blocks layer, which stores census block boundaries and their characteristics within the United States, along with the San Francisco neighborhoods layer from Chap. F5.0 to create a population density map for the city of San Francisco.</p>
|
||||||
<p>We start by loading the census blocks and San Francisco neighborhoods layers. We use ee.Filter.bounds to filter the census blocks layer to the San Francisco boundary.</p>
|
<p>We start by loading the census blocks and San Francisco neighborhoods layers. We use ee.Filter.bounds to filter the census blocks layer to the San Francisco boundary.</p>
|
||||||
<div class="sourceCode" id="cb58"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> blocks <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>(<span class="st">'TIGER/2010/Blocks'</span>)<span class="op">;</span> </span>
|
<div class="sourceCode" id="cb58"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> blocks <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>(<span class="st">'TIGER/2010/Blocks'</span>)<span class="op">;</span> </span>
|
||||||
@@ -1965,7 +1953,7 @@ Chapter Information
|
|||||||
<span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">color</span><span class="op">:</span> <span class="st">'#de2d26'</span>}<span class="op">,</span> <span class="st">'Census Blocks (single color)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">color</span><span class="op">:</span> <span class="st">'#de2d26'</span>}<span class="op">,</span> <span class="st">'Census Blocks (single 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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image34.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image34.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.1 San Francisco census blocks</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.1 San Francisco census blocks</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -1995,13 +1983,13 @@ Chapter Information
|
|||||||
<span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfBlocksPaint<span class="op">.</span><span class="fu">clip</span>(geometry)<span class="op">,</span> visParams<span class="op">,</span> <span class="st">'Population Density'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfBlocksPaint<span class="op">.</span><span class="fu">clip</span>(geometry)<span class="op">,</span> visParams<span class="op">,</span> <span class="st">'Population Density'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image41.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image41.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.2 San Francisco population density</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.2 San Francisco population density</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="creating-a-categorical-map" class="level4" data-number="7.4.1.2">
|
<section id="creating-a-categorical-map" class="level4">
|
||||||
<h4 data-number="7.4.1.2" class="anchored" data-anchor-id="creating-a-categorical-map"><span class="header-section-number">7.4.1.2</span> Creating a Categorical Map</h4>
|
<h4 class="anchored" data-anchor-id="creating-a-categorical-map">Creating a Categorical Map</h4>
|
||||||
<p>Continuing the exploration of styling methods, we will now learn about draw and style. These are the preferred methods of styling for points and line layers. Let’s see how we can visualize the TIGER: US Census Roads layer to create a categorical map.</p>
|
<p>Continuing the exploration of styling methods, we will now learn about draw and style. These are the preferred methods of styling for points and line layers. Let’s see how we can visualize the TIGER: US Census Roads layer to create a categorical map.</p>
|
||||||
<p>We start by filtering the roads layer to the San Francisco boundary and using Map.addLayer to visualize it.</p>
|
<p>We start by filtering the roads layer to the San Francisco boundary and using Map.addLayer to visualize it.</p>
|
||||||
<div class="sourceCode" id="cb63"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Filter roads to San Francisco boundary. </span></span>
|
<div class="sourceCode" id="cb63"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Filter roads to San Francisco boundary. </span></span>
|
||||||
@@ -2016,10 +2004,10 @@ Chapter Information
|
|||||||
<span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">strokeWidth</span><span class="op">:</span> <span class="dv">1</span> </span>
|
<span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">strokeWidth</span><span class="op">:</span> <span class="dv">1</span> </span>
|
||||||
<span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
<span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span> </span>
|
||||||
<span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfRoadsDraw<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Roads (Draw)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfRoadsDraw<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Roads (Draw)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/F5/image28.png" class="img-fluid"></p>
|
<p><img src="images/F5/image28.png" class="img-fluid"></p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image31.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image31.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.3 San Francisco roads rendered with a line width of 2 pixels (left) and and a line width of 1 pixel (right)</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.3 San Francisco roads rendered with a line width of 2 pixels (left) and and a line width of 1 pixel (right)</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2040,7 +2028,7 @@ Chapter Information
|
|||||||
<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfRoadsStyle<span class="op">.</span><span class="fu">clip</span>(geometry)<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Roads (Style)'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfRoadsStyle<span class="op">.</span><span class="fu">clip</span>(geometry)<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Roads (Style)'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image46.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image46.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.4 San Francisco roads rendered according to road priority</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.4 San Francisco roads rendered according to road priority</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2060,8 +2048,8 @@ Note
|
|||||||
<p>Save your script for your own future use, as outlined in Chap. F1.0. Then, refresh the Code Editor to begin with a new script for the next section.</p>
|
<p>Save your script for your own future use, as outlined in Chap. F1.0. Then, refresh the Code Editor to begin with a new script for the next section.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="joins-with-feature-collections" class="level3" data-number="7.4.2">
|
<section id="joins-with-feature-collections" class="level3">
|
||||||
<h3 data-number="7.4.2" class="anchored" data-anchor-id="joins-with-feature-collections"><span class="header-section-number">7.4.2</span> Joins with Feature Collections</h3>
|
<h3 class="anchored" data-anchor-id="joins-with-feature-collections">Joins with Feature Collections</h3>
|
||||||
<p>Earth Engine was designed as a platform for processing raster data, and that is where it shines. Over the years, it has acquired advanced vector data processing capabilities, and users are now able to carry out complex geoprocessing tasks within Earth Engine. You can leverage the distributed processing power of Earth Engine to process large vector layers in parallel.</p>
|
<p>Earth Engine was designed as a platform for processing raster data, and that is where it shines. Over the years, it has acquired advanced vector data processing capabilities, and users are now able to carry out complex geoprocessing tasks within Earth Engine. You can leverage the distributed processing power of Earth Engine to process large vector layers in parallel.</p>
|
||||||
<p>This section shows how you can do spatial queries and spatial joins using multiple large feature collections. This requires the use of joins. As described for Image Collections in Chap. F4.9, a join allows you to match every item in a collection with items in another collection based on certain conditions. While you can achieve similar results using map and filter, joins perform better and give you more flexibility. We need to define the following items to perform a join on two collections.</p>
|
<p>This section shows how you can do spatial queries and spatial joins using multiple large feature collections. This requires the use of joins. As described for Image Collections in Chap. F4.9, a join allows you to match every item in a collection with items in another collection based on certain conditions. While you can achieve similar results using map and filter, joins perform better and give you more flexibility. We need to define the following items to perform a join on two collections.</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
@@ -2069,8 +2057,8 @@ Note
|
|||||||
<li>Join type: While the filter determines which features will be joined, the join type determines how they will be joined. There are many join types, including simple join, inner join, and save-all join.</li>
|
<li>Join type: While the filter determines which features will be joined, the join type determines how they will be joined. There are many join types, including simple join, inner join, and save-all join.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<p>Joins are one of the harder skills to master, but doing so will help you perform many complex analysis tasks within Earth Engine. We will go through practical examples that will help you understand these concepts and the workflow better.</p>
|
<p>Joins are one of the harder skills to master, but doing so will help you perform many complex analysis tasks within Earth Engine. We will go through practical examples that will help you understand these concepts and the workflow better.</p>
|
||||||
<section id="selecting-by-location" class="level4" data-number="7.4.2.1">
|
<section id="selecting-by-location" class="level4">
|
||||||
<h4 data-number="7.4.2.1" class="anchored" data-anchor-id="selecting-by-location"><span class="header-section-number">7.4.2.1</span> Selecting by Location</h4>
|
<h4 class="anchored" data-anchor-id="selecting-by-location">Selecting by Location</h4>
|
||||||
<p>In this section, we will learn how to select features from one layer that are within a specified distance from features in another layer. We will continue to work with the San Francisco census blocks and roads datasets from the previous section. We will implement a join to select all blocks in San Francisco that are within 1 km of an interstate highway.</p>
|
<p>In this section, we will learn how to select features from one layer that are within a specified distance from features in another layer. We will continue to work with the San Francisco census blocks and roads datasets from the previous section. We will implement a join to select all blocks in San Francisco that are within 1 km of an interstate highway.</p>
|
||||||
<p>We start by loading the census blocks and roads collections and filtering the roads layer to the San Francisco boundary.</p>
|
<p>We start by loading the census blocks and roads collections and filtering the roads layer to the San Francisco boundary.</p>
|
||||||
<div class="sourceCode" id="cb68"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb68-1"><a href="#cb68-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> blocks <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>(<span class="st">'TIGER/2010/Blocks'</span>)<span class="op">;</span> </span>
|
<div class="sourceCode" id="cb68"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb68-1"><a href="#cb68-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> blocks <span class="op">=</span> ee<span class="op">.</span><span class="fu">FeatureCollection</span>(<span class="st">'TIGER/2010/Blocks'</span>)<span class="op">;</span> </span>
|
||||||
@@ -2098,7 +2086,7 @@ Note
|
|||||||
<span id="cb70-10"><a href="#cb70-10" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(interstateRoadsDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Interstate Roads'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb70-10"><a href="#cb70-10" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(interstateRoadsDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Interstate Roads'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image2.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image2.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.5 San Francisco blocks and interstate highways</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.5 San Francisco blocks and interstate highways</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2123,13 +2111,13 @@ Note
|
|||||||
<span id="cb73-5"><a href="#cb73-5" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(closeBlocksDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Blocks within 1km'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb73-5"><a href="#cb73-5" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(closeBlocksDrawn<span class="op">,</span> {}<span class="op">,</span> <span class="st">'Blocks within 1km'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image40.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image40.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.6 Selected blocks within 1 km of an interstate highway</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.6 Selected blocks within 1 km of an interstate highway</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section id="spatial-joins" class="level4" data-number="7.4.2.2">
|
<section id="spatial-joins" class="level4">
|
||||||
<h4 data-number="7.4.2.2" class="anchored" data-anchor-id="spatial-joins"><span class="header-section-number">7.4.2.2</span> Spatial Joins</h4>
|
<h4 class="anchored" data-anchor-id="spatial-joins">Spatial Joins</h4>
|
||||||
<p>A spatial join allows you to query two collections based on the spatial relationship. We will now implement a spatial join to count points in polygons. We will work with a dataset of tree locations in San Francisco and polygons of neighborhoods to produce a CSV file with the total number of trees in each neighborhood.</p>
|
<p>A spatial join allows you to query two collections based on the spatial relationship. We will now implement a spatial join to count points in polygons. We will work with a dataset of tree locations in San Francisco and polygons of neighborhoods to produce a CSV file with the total number of trees in each neighborhood.</p>
|
||||||
<p>The San Francisco Open Data Portal maintains a street tree map dataset that has a list of street trees with their latitude and longitude. We will also use the San Francisco neighborhood dataset from the same portal. We downloaded, processed, and uploaded these layers as Earth Engine assets for use in this exercise. We start by loading both layers and using the paint and style functions, covered in Sect. 1, to visualize them (Fig. F5.3.7).</p>
|
<p>The San Francisco Open Data Portal maintains a street tree map dataset that has a list of street trees with their latitude and longitude. We will also use the San Francisco neighborhood dataset from the same portal. We downloaded, processed, and uploaded these layers as Earth Engine assets for use in this exercise. We start by loading both layers and using the paint and style functions, covered in Sect. 1, to visualize them (Fig. F5.3.7).</p>
|
||||||
<p>var sfNeighborhoods = ee.FeatureCollection( ‘projects/gee-book/assets/F5-0/SFneighborhoods’);<br>
|
<p>var sfNeighborhoods = ee.FeatureCollection( ‘projects/gee-book/assets/F5-0/SFneighborhoods’);<br>
|
||||||
@@ -2154,7 +2142,7 @@ var sfTrees = ee.FeatureCollection( ‘projects/gee-book/assets/F5-3/SFTrees’)
|
|||||||
<span id="cb74-18"><a href="#cb74-18" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfTreesStyled<span class="op">,</span> {}<span class="op">,</span> <span class="st">'SF Trees'</span>)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb74-18"><a href="#cb74-18" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(sfTreesStyled<span class="op">,</span> {}<span class="op">,</span> <span class="st">'SF Trees'</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image35.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image35.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.7 San Francisco neighborhoods and trees</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.7 San Francisco neighborhoods and trees</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2174,7 +2162,7 @@ var sfTrees = ee.FeatureCollection( ‘projects/gee-book/assets/F5-3/SFTrees’)
|
|||||||
<span id="cb77-3"><a href="#cb77-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(joined<span class="op">.</span><span class="fu">first</span>())<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb77-3"><a href="#cb77-3" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(joined<span class="op">.</span><span class="fu">first</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image1.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image1.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.8 Result of the save-all join</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.8 Result of the save-all join</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2186,7 +2174,7 @@ var sfTrees = ee.FeatureCollection( ‘projects/gee-book/assets/F5-3/SFTrees’)
|
|||||||
<span id="cb78-5"><a href="#cb78-5" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(sfNeighborhoods<span class="op">.</span><span class="fu">first</span>())<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb78-5"><a href="#cb78-5" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(sfNeighborhoods<span class="op">.</span><span class="fu">first</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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image18.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image18.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.9 Final FeatureCollection with the new property</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.9 Final FeatureCollection with the new property</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2204,7 +2192,7 @@ var sfTrees = ee.FeatureCollection( ‘projects/gee-book/assets/F5-3/SFTrees’)
|
|||||||
<p>The final result is a CSV file with the neighborhood names and total numbers of trees counted using the join (Fig. F5.3.10).</p>
|
<p>The final result is a CSV file with the neighborhood names and total numbers of trees counted using the join (Fig. F5.3.10).</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/F5/image3.png" class="img-fluid figure-img"></p>
|
<p><img src="images/F5/image3.png" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Fig. F5.3.10 Exported CSV file with tree counts for San Francisco neighborhoods</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Fig. F5.3.10 Exported CSV file with tree counts for San Francisco neighborhoods</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -2583,12 +2571,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./B3_Image_Series.html" class="pagination-link">
|
<a href="./B3_Image_Series.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Image Series</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./C1_Lights.html" class="pagination-link">
|
<a href="./C1_Lights.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">War at Night</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setOptions</span>(<span class="st">'HYBRID'</span>)</span>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setOptions</span>(<span class="st">'HYBRID'</span>)</span>
|
||||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">centerObject</span>(AOI)</span>
|
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">centerObject</span>(AOI)</span>
|
||||||
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(VIIRS<span class="op">.</span><span class="fu">first</span>()<span class="op">,</span>VIIRSvis<span class="op">,</span><span class="st">'Nighttime Lights'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">addLayer</span>(VIIRS<span class="op">.</span><span class="fu">first</span>()<span class="op">,</span>VIIRSvis<span class="op">,</span><span class="st">'Nighttime Lights'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/iraq_check.png" class="img-fluid"></p>
|
<p><img src="images/iraq_check.png" class="img-fluid"></p>
|
||||||
<p>If we decrease the opacity of the VIIRS layer, we can see the cities of Mosul, Erbil and Kirkuk shining brightly at night. We can also see a string of bright lights between Kirkuk and Erbil – these are methane flares from oil wells.</p>
|
<p>If we decrease the opacity of the VIIRS layer, we can see the cities of Mosul, Erbil and Kirkuk shining brightly at night. We can also see a string of bright lights between Kirkuk and Erbil – these are methane flares from oil wells.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="analysis" class="level2">
|
<section id="analysis" class="level2">
|
||||||
@@ -461,7 +461,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gif</span>(VIIRS<span class="op">,</span> VIIRSvis<span class="op">,</span> AOI)<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<div class="sourceCode" id="cb5"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gif</span>(VIIRS<span class="op">,</span> VIIRSvis<span class="op">,</span> AOI)<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">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/Figure_1.gif" class="img-fluid figure-img"></p>
|
<p><img src="images/Figure_1.gif" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">I’ve done a bit of post-processing to this gif, adding more annotations and blending between frames to make it a bit smoother. I typically use <a href="https://ffmpeg.org/">ffmpeg</a> and <a href="https://ezgif.com/">ezgif</a> for the finishing touches.</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">I’ve done a bit of post-processing to this gif, adding more annotations and blending between frames to make it a bit smoother. I typically use <a href="https://ffmpeg.org/">ffmpeg</a> and <a href="https://ezgif.com/">ezgif</a> for the finishing touches.</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -510,7 +510,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a> })<span class="op">;</span></span>
|
<span id="cb7-10"><a href="#cb7-10" aria-hidden="true" tabindex="-1"></a> })<span class="op">;</span></span>
|
||||||
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a> </span>
|
<span id="cb7-11"><a href="#cb7-11" aria-hidden="true" tabindex="-1"></a> </span>
|
||||||
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(chart)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb7-12"><a href="#cb7-12" aria-hidden="true" tabindex="-1"></a><span class="fu">print</span>(chart)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p><img src="../images/qayyarah_chart.png" class="img-fluid"></p>
|
<p><img src="images/qayyarah_chart.png" class="img-fluid"></p>
|
||||||
<p>We can clearly see Mosul (the red line) darkening in 2014 as the city is taken by ISIS. During this period the Qayyarah oil fields are, as we might expect, quite dark. All of a sudden in 2016 Qayyarah becomes brighter at night than the city of Mosul ever was, as the oilfields are set on fire. Then, almost exactly when the blaze in Qayyarah is extinguished and the area darkens (i.e. when the blue line falls back to near zero), Mosul brightens once again (i.e. the red line rises) as the city is liberated.</p>
|
<p>We can clearly see Mosul (the red line) darkening in 2014 as the city is taken by ISIS. During this period the Qayyarah oil fields are, as we might expect, quite dark. All of a sudden in 2016 Qayyarah becomes brighter at night than the city of Mosul ever was, as the oilfields are set on fire. Then, almost exactly when the blaze in Qayyarah is extinguished and the area darkens (i.e. when the blue line falls back to near zero), Mosul brightens once again (i.e. the red line rises) as the city is liberated.</p>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 10 Blast Damage Assessment</title>
|
<title>Remote Sensing for OSINT - Blast Damage Assessment</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
span.smallcaps{font-variant: small-caps;}
|
||||||
@@ -201,20 +201,17 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -230,26 +227,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -265,32 +258,27 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link active">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -305,19 +293,19 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#change-detection" id="toc-change-detection" class="nav-link active" data-scroll-target="#change-detection"><span class="header-section-number">10.1</span> Change Detection</a></li>
|
<li><a href="#change-detection" id="toc-change-detection" class="nav-link active" data-scroll-target="#change-detection">Change Detection</a></li>
|
||||||
<li><a href="#implementing-a-t-test-in-earth-engine" id="toc-implementing-a-t-test-in-earth-engine" class="nav-link" data-scroll-target="#implementing-a-t-test-in-earth-engine"><span class="header-section-number">10.2</span> Implementing a t-test in Earth Engine</a></li>
|
<li><a href="#implementing-a-t-test-in-earth-engine" id="toc-implementing-a-t-test-in-earth-engine" class="nav-link" data-scroll-target="#implementing-a-t-test-in-earth-engine">Implementing a t-test in Earth Engine</a></li>
|
||||||
<li><a href="#filtering-the-sentinel-1-imagery" id="toc-filtering-the-sentinel-1-imagery" class="nav-link" data-scroll-target="#filtering-the-sentinel-1-imagery"><span class="header-section-number">10.3</span> Filtering the Sentinel-1 Imagery</a></li>
|
<li><a href="#filtering-the-sentinel-1-imagery" id="toc-filtering-the-sentinel-1-imagery" class="nav-link" data-scroll-target="#filtering-the-sentinel-1-imagery">Filtering the Sentinel-1 Imagery</a></li>
|
||||||
<li><a href="#validation" id="toc-validation" class="nav-link" data-scroll-target="#validation"><span class="header-section-number">10.4</span> Validation</a></li>
|
<li><a href="#validation" id="toc-validation" class="nav-link" data-scroll-target="#validation">Validation</a></li>
|
||||||
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion"><span class="header-section-number">10.5</span> Conclusion</a></li>
|
<li><a href="#conclusion" id="toc-conclusion" class="nav-link" data-scroll-target="#conclusion">Conclusion</a></li>
|
||||||
<li><a href="#extension-satellite-imagery-and-its-limits" id="toc-extension-satellite-imagery-and-its-limits" class="nav-link" data-scroll-target="#extension-satellite-imagery-and-its-limits"><span class="header-section-number">10.6</span> Extension: Satellite Imagery and its Limits</a>
|
<li><a href="#extension-satellite-imagery-and-its-limits" id="toc-extension-satellite-imagery-and-its-limits" class="nav-link" data-scroll-target="#extension-satellite-imagery-and-its-limits">Extension: Satellite Imagery and its Limits</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#creating-a-3d-model-of-beirut" id="toc-creating-a-3d-model-of-beirut" class="nav-link" data-scroll-target="#creating-a-3d-model-of-beirut"><span class="header-section-number">10.6.1</span> Creating a 3D model of Beirut</a></li>
|
<li><a href="#creating-a-3d-model-of-beirut" id="toc-creating-a-3d-model-of-beirut" class="nav-link" data-scroll-target="#creating-a-3d-model-of-beirut">Creating a 3D model of Beirut</a></li>
|
||||||
<li><a href="#using-a-viewshed-analysis-to-assess-blast-exposure" id="toc-using-a-viewshed-analysis-to-assess-blast-exposure" class="nav-link" data-scroll-target="#using-a-viewshed-analysis-to-assess-blast-exposure"><span class="header-section-number">10.6.2</span> Using a Viewshed Analysis to Assess Blast Exposure</a></li>
|
<li><a href="#using-a-viewshed-analysis-to-assess-blast-exposure" id="toc-using-a-viewshed-analysis-to-assess-blast-exposure" class="nav-link" data-scroll-target="#using-a-viewshed-analysis-to-assess-blast-exposure">Using a Viewshed Analysis to Assess Blast Exposure</a></li>
|
||||||
<li><a href="#accounting-for-diffraction" id="toc-accounting-for-diffraction" class="nav-link" data-scroll-target="#accounting-for-diffraction"><span class="header-section-number">10.6.3</span> Accounting for Diffraction</a></li>
|
<li><a href="#accounting-for-diffraction" id="toc-accounting-for-diffraction" class="nav-link" data-scroll-target="#accounting-for-diffraction">Accounting for Diffraction</a></li>
|
||||||
<li><a href="#modeling-the-pressure-wave" id="toc-modeling-the-pressure-wave" class="nav-link" data-scroll-target="#modeling-the-pressure-wave"><span class="header-section-number">10.6.4</span> Modeling the Pressure Wave</a></li>
|
<li><a href="#modeling-the-pressure-wave" id="toc-modeling-the-pressure-wave" class="nav-link" data-scroll-target="#modeling-the-pressure-wave">Modeling the Pressure Wave</a></li>
|
||||||
<li><a href="#assessing-damage-to-the-skyline-tower" id="toc-assessing-damage-to-the-skyline-tower" class="nav-link" data-scroll-target="#assessing-damage-to-the-skyline-tower"><span class="header-section-number">10.6.5</span> Assessing Damage to the Skyline Tower</a></li>
|
<li><a href="#assessing-damage-to-the-skyline-tower" id="toc-assessing-damage-to-the-skyline-tower" class="nav-link" data-scroll-target="#assessing-damage-to-the-skyline-tower">Assessing Damage to the Skyline Tower</a></li>
|
||||||
<li><a href="#further-research" id="toc-further-research" class="nav-link" data-scroll-target="#further-research"><span class="header-section-number">10.6.6</span> Further Research</a></li>
|
<li><a href="#further-research" id="toc-further-research" class="nav-link" data-scroll-target="#further-research">Further Research</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/C3_Blast.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/C3_Blast.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
||||||
@@ -327,7 +315,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></h1>
|
<h1 class="title"><span class="chapter-title">Blast Damage Assessment</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -354,8 +342,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<iframe src="https://ollielballinger.users.earthengine.app/view/beirutsar" width="100%" height="700px">
|
<iframe src="https://ollielballinger.users.earthengine.app/view/beirutsar" width="100%" height="700px">
|
||||||
</iframe>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
<section id="change-detection" class="level2" data-number="10.1">
|
<section id="change-detection" class="level2">
|
||||||
<h2 data-number="10.1" class="anchored" data-anchor-id="change-detection"><span class="header-section-number">10.1</span> Change Detection</h2>
|
<h2 class="anchored" data-anchor-id="change-detection">Change Detection</h2>
|
||||||
<p>There are many ways to detect change between two images. The simplest way would be to take an image taken before an event, and subtract it from an image taken after. This is a good way to get a general sense of where change has occurred, but if you only use two images (one before an event and another after), it would be difficult to differentiate between areas that have changed as a result of the event in question, and areas that have changed for other reasons. Things in Beirut (and cities in general) are constantly changing: construction, cars/planes/ships moving, vegetation growing, etc. So we wouldn’t know if the change we’re seeing is a result of the explosion or whether that area is generally prone to change. We can overcome this by comparing a bunch of pre-event images to a bunch of post-event images. This way we can see if the change we’re seeing is consistent across all of the images. If it is, then we can be fairly confident that the change is a result of the event in question. The mean is simply the sum of all the values (<span class="math inline">\(x_i\)</span>) in a set divided by the number of values (<span class="math inline">\(n\)</span>):</p>
|
<p>There are many ways to detect change between two images. The simplest way would be to take an image taken before an event, and subtract it from an image taken after. This is a good way to get a general sense of where change has occurred, but if you only use two images (one before an event and another after), it would be difficult to differentiate between areas that have changed as a result of the event in question, and areas that have changed for other reasons. Things in Beirut (and cities in general) are constantly changing: construction, cars/planes/ships moving, vegetation growing, etc. So we wouldn’t know if the change we’re seeing is a result of the explosion or whether that area is generally prone to change. We can overcome this by comparing a bunch of pre-event images to a bunch of post-event images. This way we can see if the change we’re seeing is consistent across all of the images. If it is, then we can be fairly confident that the change is a result of the event in question. The mean is simply the sum of all the values (<span class="math inline">\(x_i\)</span>) in a set divided by the number of values (<span class="math inline">\(n\)</span>):</p>
|
||||||
<p><span class="math display">\[\large \overline{x} = \frac{1}{n} \sum_{i=1}^n x_i\]</span></p>
|
<p><span class="math display">\[\large \overline{x} = \frac{1}{n} \sum_{i=1}^n x_i\]</span></p>
|
||||||
<p>But if we just take the average pixel value before and subtract the average pixel value after, we’re not accounting for the <em>variability</em> of that pixel’s values. For example, if we have a pixel that has had an average value of 1 for the month before the event, and a value of 2 in the month after the event, the difference is 1. If that pixel’s value is extremely consistent (it never varies by more than 0.1), such a change would be very significant. But if that pixel’s value is very variable (it varies by 2 or even 3 on a regular basis), then the change is not significant. So we need to account for the variability of the pixel’s values using the standard deviation. It is calculated as the square root of the variance, which is the average of the squared differences from the mean:</p>
|
<p>But if we just take the average pixel value before and subtract the average pixel value after, we’re not accounting for the <em>variability</em> of that pixel’s values. For example, if we have a pixel that has had an average value of 1 for the month before the event, and a value of 2 in the month after the event, the difference is 1. If that pixel’s value is extremely consistent (it never varies by more than 0.1), such a change would be very significant. But if that pixel’s value is very variable (it varies by 2 or even 3 on a regular basis), then the change is not significant. So we need to account for the variability of the pixel’s values using the standard deviation. It is calculated as the square root of the variance, which is the average of the squared differences from the mean:</p>
|
||||||
@@ -370,8 +358,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</ul>
|
</ul>
|
||||||
<p>This procedure gives us a number called a t-value, which is a measure of how many standard deviations the difference between the two means is. We’re not going to get into the details here, but a rule of thumb is that if the t-value is greater than 2, then the difference between the two means is significant. If the t-value is less than 2, then the difference is not significant. We’re going to calculate the t-value for each pixel in the image to determine whether that pixel has changed significantly following the event in question. You don’t need to know the details of the t-test to understand the results (but hopefully you’ve got an intuition for what it’s doing). If you’re interested in learning more about statistical tests of this sort, I teach a course on Data Science at the University College London, and have made all of the lectures and courseware open-source. The T-test lecture is here.</p>
|
<p>This procedure gives us a number called a t-value, which is a measure of how many standard deviations the difference between the two means is. We’re not going to get into the details here, but a rule of thumb is that if the t-value is greater than 2, then the difference between the two means is significant. If the t-value is less than 2, then the difference is not significant. We’re going to calculate the t-value for each pixel in the image to determine whether that pixel has changed significantly following the event in question. You don’t need to know the details of the t-test to understand the results (but hopefully you’ve got an intuition for what it’s doing). If you’re interested in learning more about statistical tests of this sort, I teach a course on Data Science at the University College London, and have made all of the lectures and courseware open-source. The T-test lecture is here.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="implementing-a-t-test-in-earth-engine" class="level2" data-number="10.2">
|
<section id="implementing-a-t-test-in-earth-engine" class="level2">
|
||||||
<h2 data-number="10.2" class="anchored" data-anchor-id="implementing-a-t-test-in-earth-engine"><span class="header-section-number">10.2</span> Implementing a t-test in Earth Engine</h2>
|
<h2 class="anchored" data-anchor-id="implementing-a-t-test-in-earth-engine">Implementing a t-test in Earth Engine</h2>
|
||||||
<p>Now lets go about implementing this in Earth Engine. We’ll start by centering the map on the port of Beirut, and setting the map to satellite view, and defining an area of interest (AOI) as a 3km buffer around the port:</p>
|
<p>Now lets go about implementing this in Earth Engine. We’ll start by centering the map on the port of Beirut, and setting the map to satellite view, and defining an area of interest (AOI) as a 3km buffer around the port:</p>
|
||||||
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setCenter</span>(<span class="fl">35.51898</span><span class="op">,</span> <span class="fl">33.90153</span><span class="op">,</span> <span class="dv">15</span>)<span class="op">;</span></span>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setCenter</span>(<span class="fl">35.51898</span><span class="op">,</span> <span class="fl">33.90153</span><span class="op">,</span> <span class="dv">15</span>)<span class="op">;</span></span>
|
||||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
|
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||||
@@ -451,8 +439,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>First, the algorithm above returns tha <em>absolute</em> value of t (i.e. the absolute value of the difference between the two means). This is because we’re interested in whether the pixel has changed at all, not whether it’s changed in a particular direction. Second, we’ve subtracted 2 from the t-value.</p>
|
<p>First, the algorithm above returns tha <em>absolute</em> value of t (i.e. the absolute value of the difference between the two means). This is because we’re interested in whether the pixel has changed at all, not whether it’s changed in a particular direction. Second, we’ve subtracted 2 from the t-value.</p>
|
||||||
<p>The t-value is a measure of how many standard deviations the difference between the two means is. Generally speaking, if the t-value is greater than 2, then the difference between the two means is considered statistically significant. 2 is a fairly arbitrary cutoff, but it’s the most commonly used one since it corresponds to the 95% confidence interval (i.e., there’s less than a 5% chance of observing a difference that big due to random chance). Now we’ve got a function that can take an image collection and return a t-value image, where a value greater than 0 corresponds to a statistically significant change between the pre-event and post-event periods.</p>
|
<p>The t-value is a measure of how many standard deviations the difference between the two means is. Generally speaking, if the t-value is greater than 2, then the difference between the two means is considered statistically significant. 2 is a fairly arbitrary cutoff, but it’s the most commonly used one since it corresponds to the 95% confidence interval (i.e., there’s less than a 5% chance of observing a difference that big due to random chance). Now we’ve got a function that can take an image collection and return a t-value image, where a value greater than 0 corresponds to a statistically significant change between the pre-event and post-event periods.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="filtering-the-sentinel-1-imagery" class="level2" data-number="10.3">
|
<section id="filtering-the-sentinel-1-imagery" class="level2">
|
||||||
<h2 data-number="10.3" class="anchored" data-anchor-id="filtering-the-sentinel-1-imagery"><span class="header-section-number">10.3</span> Filtering the Sentinel-1 Imagery</h2>
|
<h2 class="anchored" data-anchor-id="filtering-the-sentinel-1-imagery">Filtering the Sentinel-1 Imagery</h2>
|
||||||
<p>We can’t just blindly apply this algorithm to the entire image collection, because the image collection contains images from both ascending and descending orbits. We need to filter the image collection to the ascending and descending orbits, and then calculate the t-value for each orbit separately: this is because the satellite is viewing the scene from a completely different angle when it’s in ascending and descending orbits, which will generate a lot of noise in our data. In fact, even when the satellite is either ascending or descending, we can have multiple images of the same place taken from slightly different orbital tracks because these overlap (see <a href="./ch1#orbits">this visualization of orbits</a>). We need to filter the image collection to the relative orbit number that is most common within the image collection. For that, we define a new function called ‘filter_s1’, which takes a single argument: the path (either ‘ASCENDING’ or ‘DESCENDING’).</p>
|
<p>We can’t just blindly apply this algorithm to the entire image collection, because the image collection contains images from both ascending and descending orbits. We need to filter the image collection to the ascending and descending orbits, and then calculate the t-value for each orbit separately: this is because the satellite is viewing the scene from a completely different angle when it’s in ascending and descending orbits, which will generate a lot of noise in our data. In fact, even when the satellite is either ascending or descending, we can have multiple images of the same place taken from slightly different orbital tracks because these overlap (see <a href="./ch1#orbits">this visualization of orbits</a>). We need to filter the image collection to the relative orbit number that is most common within the image collection. For that, we define a new function called ‘filter_s1’, which takes a single argument: the path (either ‘ASCENDING’ or ‘DESCENDING’).</p>
|
||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">filter_s1</span>(path) {</span>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">filter_s1</span>(path) {</span>
|
||||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> </span>
|
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> </span>
|
||||||
@@ -513,22 +501,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>The visualization parameters correspond to the statistical significance of the change in pixel values. Using the Viridis color palette which ranges from purple to yellow, dark purple pixels indicate no significant change, and yellow pixels indicate a significant change with with 95% confidence. The brighter the yellow of a pixel, the more significant the change.</p>
|
<p>The visualization parameters correspond to the statistical significance of the change in pixel values. Using the Viridis color palette which ranges from purple to yellow, dark purple pixels indicate no significant change, and yellow pixels indicate a significant change with with 95% confidence. The brighter the yellow of a pixel, the more significant the change.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/beirut/beirut_change_2020.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/beirut/beirut_change_2020.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Pixelwise T-Test, 2020</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Pixelwise T-Test, 2020</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>This seems to be working quite well; but remember, ports are generally prone to change. The t-test is accounting for this by calculating each pixel’s variance over the entire time period, but it’s still possible that the change we’re seeing is due to the port rather than the explosion. To test this, we can run the same algorithm on the same area, using the same date cutoff (August 4th), but in a different year; I’ve chosen 2018. This is what’s known as a placebo test: if it’s still showing loads of statistically significant change around the cutoff, our algorithm is probably picking up on port activity rather than the explosion.</p>
|
<p>This seems to be working quite well; but remember, ports are generally prone to change. The t-test is accounting for this by calculating each pixel’s variance over the entire time period, but it’s still possible that the change we’re seeing is due to the port rather than the explosion. To test this, we can run the same algorithm on the same area, using the same date cutoff (August 4th), but in a different year; I’ve chosen 2018. This is what’s known as a placebo test: if it’s still showing loads of statistically significant change around the cutoff, our algorithm is probably picking up on port activity rather than the explosion.</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/beirut/beirut_change_2018.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/beirut/beirut_change_2018.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Pixelwise T-Test, 2018</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Pixelwise T-Test, 2018</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>Compared to the 2020 image, there’s a lot less yellow (significant change). That being said, there are a few yellow areas. This could be due to a number of reasons: ships coming and going, cranes moving, and containers being loaded and unloaded would all register in the change detection algorithm. There are also a number of yellow specks throughout the city, which is also to be expected since cities are also generally in a state of flux. Construction, demolition, and even the growth of vegetation can all be detected by the algorithm.</p>
|
<p>Compared to the 2020 image, there’s a lot less yellow (significant change). That being said, there are a few yellow areas. This could be due to a number of reasons: ships coming and going, cranes moving, and containers being loaded and unloaded would all register in the change detection algorithm. There are also a number of yellow specks throughout the city, which is also to be expected since cities are also generally in a state of flux. Construction, demolition, and even the growth of vegetation can all be detected by the algorithm.</p>
|
||||||
<p>However, the scale and quantity of the change is nowhere near what it was for the 2020 image. This is a good sign that the algorithm is detecting change resulting from the explosion.</p>
|
<p>However, the scale and quantity of the change is nowhere near what it was for the 2020 image. This is a good sign that the algorithm is detecting change resulting from the explosion.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="validation" class="level2" data-number="10.4">
|
<section id="validation" class="level2">
|
||||||
<h2 data-number="10.4" class="anchored" data-anchor-id="validation"><span class="header-section-number">10.4</span> Validation</h2>
|
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
|
||||||
<p>Great. We’ve developed our very own change detection algorithm in earth engine, applied it to the Beirut explosion, and it seems to be working after checking with a basic placebo test. But how do we know that it’s correctly predicting the <em>extent</em> of the damage, and not wildly over/underestimating?</p>
|
<p>Great. We’ve developed our very own change detection algorithm in earth engine, applied it to the Beirut explosion, and it seems to be working after checking with a basic placebo test. But how do we know that it’s correctly predicting the <em>extent</em> of the damage, and not wildly over/underestimating?</p>
|
||||||
<p>Given that this was a few years ago, we have the benefit of hindsight. In particular, the United Nations and the Municipality of Beirut have <a href="https://unhabitat.org/sites/default/files/2020/10/municipality_of_beirut_-_beirut_explosion_rapid_assessment_report.pdf">published a report</a> on the damage caused by the explosion. This report includes estimates of the number of buildings damaged or destroyed, as well as the number of people displaced. The report states that approximately 10,000 buildings were damaged within a 3 kilometre radius of the port. If our algorithm suggests that only 1,000 buildings were damaged, it’s undershooting. If it suggests that 100,000 buildings were damaged, it’s overshooting.</p>
|
<p>Given that this was a few years ago, we have the benefit of hindsight. In particular, the United Nations and the Municipality of Beirut have <a href="https://unhabitat.org/sites/default/files/2020/10/municipality_of_beirut_-_beirut_explosion_rapid_assessment_report.pdf">published a report</a> on the damage caused by the explosion. This report includes estimates of the number of buildings damaged or destroyed, as well as the number of people displaced. The report states that approximately 10,000 buildings were damaged within a 3 kilometre radius of the port. If our algorithm suggests that only 1,000 buildings were damaged, it’s undershooting. If it suggests that 100,000 buildings were damaged, it’s overshooting.</p>
|
||||||
<p>Using building footprint data and the t-test image we just generated, we can createe an estimate of the number of damaged buildings according to our model. First, we want to generate a thresholded image, where pixels with a value greater than 0 are set to 1, and all other pixels are set to 0. We can then use this mask to reduce the building footprints to a single value for each building, where the value is the mean of the t-test image within the footprint. If the mean value is greater than 0, the building is damaged. If it’s less than 0, the building is not damaged.</p>
|
<p>Using building footprint data and the t-test image we just generated, we can createe an estimate of the number of damaged buildings according to our model. First, we want to generate a thresholded image, where pixels with a value greater than 0 are set to 1, and all other pixels are set to 0. We can then use this mask to reduce the building footprints to a single value for each building, where the value is the mean of the t-test image within the footprint. If the mean value is greater than 0, the building is damaged. If it’s less than 0, the building is not damaged.</p>
|
||||||
@@ -595,21 +583,21 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>The result naturally resembles the underlying t-test image, with high levels of damage concentrated around the port, and progressively decreasing damage with distance:</p>
|
<p>The result naturally resembles the underlying t-test image, with high levels of damage concentrated around the port, and progressively decreasing damage with distance:</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/beirut/beirut_footprints.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/beirut/beirut_footprints.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Building Footprints colored according to estimated blast damage</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Building Footprints colored according to estimated blast damage</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>To get a better sense of how these predicitions correspond to actual damage, we can zoom in and turn on the Google satellite basemap, which has imagery taken just after the explosion; you can still see capsized boats in the port. Zooming in to the epicenter, we can see several warehouses that were effectively vaporized. Our change detection algorithm picks up on a high degree of change, as indicated by the red outlines of the building footprints:</p>
|
<p>To get a better sense of how these predicitions correspond to actual damage, we can zoom in and turn on the Google satellite basemap, which has imagery taken just after the explosion; you can still see capsized boats in the port. Zooming in to the epicenter, we can see several warehouses that were effectively vaporized. Our change detection algorithm picks up on a high degree of change, as indicated by the red outlines of the building footprints:</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/beirut/beirut_footprints_port.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/beirut/beirut_footprints_port.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Predicted damage and optical satellite imagery in the Port of Beirut, August 2020</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Predicted damage and optical satellite imagery in the Port of Beirut, August 2020</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<p>This is pretty low-hanging fruit. Let’s look at a different area, around 1.3km east from the epicenter with a mix of warehouses and residential buildings:</p>
|
<p>This is pretty low-hanging fruit. Let’s look at a different area, around 1.3km east from the epicenter with a mix of warehouses and residential buildings:</p>
|
||||||
<div class="quarto-figure quarto-figure-center">
|
<div class="quarto-figure quarto-figure-center">
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
<p><img src="../images/beirut/beirut_footprints_zoomed.jpg" class="img-fluid figure-img"></p>
|
<p><img src="images/beirut/beirut_footprints_zoomed.jpg" class="img-fluid figure-img"></p>
|
||||||
<p></p><figcaption class="figure-caption">Area east of the port: 35.533194, 33.9024</figcaption><p></p>
|
<p></p><figcaption class="figure-caption">Area east of the port: 35.533194, 33.9024</figcaption><p></p>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
@@ -618,12 +606,12 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>In Area B, we see a medium-rise building. If you look closely at the southern edge of the building, you’ll see the siding has been completely torn off and is laying on the sidewalk. The building footprint is orange, suggesting a medium amount of change. We may be underestimating a bit here.</p>
|
<p>In Area B, we see a medium-rise building. If you look closely at the southern edge of the building, you’ll see the siding has been completely torn off and is laying on the sidewalk. The building footprint is orange, suggesting a medium amount of change. We may be underestimating a bit here.</p>
|
||||||
<p>In Area C, there are a bunch of high rise buildings clustered together. The building footprints are all blue, suggesting little to no damage. This is a bit of a surprise given how damaged areas A and B are. If you squint at the satellite image, it is indeed hard to tell if these buildings are damaged because we’re looking at them from the top down, when much of the damage (e.g., the windows being blown out) would only be visible from the side. Indeed, our own estimate of the number of damaged buildings based on the algorithm we developed is about 8% shy of the U.N.’s estimate. This may be why.</p>
|
<p>In Area C, there are a bunch of high rise buildings clustered together. The building footprints are all blue, suggesting little to no damage. This is a bit of a surprise given how damaged areas A and B are. If you squint at the satellite image, it is indeed hard to tell if these buildings are damaged because we’re looking at them from the top down, when much of the damage (e.g., the windows being blown out) would only be visible from the side. Indeed, our own estimate of the number of damaged buildings based on the algorithm we developed is about 8% shy of the U.N.’s estimate. This may be why.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="conclusion" class="level2" data-number="10.5">
|
<section id="conclusion" class="level2">
|
||||||
<h2 data-number="10.5" class="anchored" data-anchor-id="conclusion"><span class="header-section-number">10.5</span> Conclusion</h2>
|
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
|
||||||
<p>In this practical example, we created a custom change detection algorithm that conducts a pixelwise t-test to detect change resulting from the 2020 explosion in the port of Beirut. By defining our own functions to do most of this analysis, we can apply the same workflow quite easily to a different context by simply moving the AOI and inputting the date of the shock. A placebo test showed that it’s not just detecting general change in the area, but specifically change resulting from the explosion: when we keep everything the same but change the year of the shock, we see very little significant change being detected. Finally, by joining the predicted damage map to building footprints, we come up with an estimate of 9,256 damaged buildings, which is pretty close to the U.N.’s estimate of 10,000. That concludes the portion of this case study that deals with Earth Engine, but if you’re interested in learning more about why we’re coming up a bit short on the damage estimate (and some different ways of looking at the problem), read on.</p>
|
<p>In this practical example, we created a custom change detection algorithm that conducts a pixelwise t-test to detect change resulting from the 2020 explosion in the port of Beirut. By defining our own functions to do most of this analysis, we can apply the same workflow quite easily to a different context by simply moving the AOI and inputting the date of the shock. A placebo test showed that it’s not just detecting general change in the area, but specifically change resulting from the explosion: when we keep everything the same but change the year of the shock, we see very little significant change being detected. Finally, by joining the predicted damage map to building footprints, we come up with an estimate of 9,256 damaged buildings, which is pretty close to the U.N.’s estimate of 10,000. That concludes the portion of this case study that deals with Earth Engine, but if you’re interested in learning more about why we’re coming up a bit short on the damage estimate (and some different ways of looking at the problem), read on.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="extension-satellite-imagery-and-its-limits" class="level2" data-number="10.6">
|
<section id="extension-satellite-imagery-and-its-limits" class="level2">
|
||||||
<h2 data-number="10.6" class="anchored" data-anchor-id="extension-satellite-imagery-and-its-limits"><span class="header-section-number">10.6</span> Extension: Satellite Imagery and its Limits</h2>
|
<h2 class="anchored" data-anchor-id="extension-satellite-imagery-and-its-limits">Extension: Satellite Imagery and its Limits</h2>
|
||||||
<p>Though satellite imagery analysis is undoubtedly one of the best tools we have at our disposal to analyze this sort of phenomenon, it appears to systematically underestimate the extent of damage in Beirut. I outline an alternative approach using Open Street Map data to create a 3D model of Beirut and the explosion to analyze directional blast damage. Again, we’re now leaving Earth Engine and moving to Blender, so if you’re not interested in that feel free to skip ahead to the next case study.</p>
|
<p>Though satellite imagery analysis is undoubtedly one of the best tools we have at our disposal to analyze this sort of phenomenon, it appears to systematically underestimate the extent of damage in Beirut. I outline an alternative approach using Open Street Map data to create a 3D model of Beirut and the explosion to analyze directional blast damage. Again, we’re now leaving Earth Engine and moving to Blender, so if you’re not interested in that feel free to skip ahead to the next case study.</p>
|
||||||
<p>Below is one of the most viewed videos of the explosion:</p>
|
<p>Below is one of the most viewed videos of the explosion:</p>
|
||||||
<blockquote class="twitter-tweet blockquote">
|
<blockquote class="twitter-tweet blockquote">
|
||||||
@@ -634,16 +622,16 @@ Stunning video shows explosions just minutes ago at Beirut port <a href="https:/
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||||
<p>Geolocating this video was pretty simple thanks to the Greek Orthodox church (highlighted in green below) and the road leading to it (highlighted in blue). The red box indicates the likely location (33.889061, 35.515909) from which the person was filming:</p>
|
<p>Geolocating this video was pretty simple thanks to the Greek Orthodox church (highlighted in green below) and the road leading to it (highlighted in blue). The red box indicates the likely location (33.889061, 35.515909) from which the person was filming:</p>
|
||||||
<p><img src="../images/beirut/IMG_2.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_2.png" class="img-fluid"></p>
|
||||||
<p>The video shows heavy damage being sustained by areas well outside the zones classified as damaged in the maps above (both my own and NASA’s). Indeed, substantial damage was reported several kilometers away.</p>
|
<p>The video shows heavy damage being sustained by areas well outside the zones classified as damaged in the maps above (both my own and NASA’s). Indeed, substantial damage was reported several kilometers away.</p>
|
||||||
<p>Why are satellite images underestimating damage in Beirut? Satellite images are taken from above, and are two-dimensional. Much of the damage caused by the blast, however, was directional; the pressure wave hit the sides of buildings, as shown in this diagram from a FEMA manual:</p>
|
<p>Why are satellite images underestimating damage in Beirut? Satellite images are taken from above, and are two-dimensional. Much of the damage caused by the blast, however, was directional; the pressure wave hit the sides of buildings, as shown in this diagram from a FEMA manual:</p>
|
||||||
<p><img src="../images/beirut/IMG_3.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_3.png" class="img-fluid"></p>
|
||||||
<p>Areas close to the explosion suffered so much damage that it could be seen from above, but even if an apartment building had all of its windows blown out, this would not necessarily be visible in a top-down view. Even for radar, which does technically collect data in three dimensions, the angle problem remains; a high resolution radar might be able to tell you how tall an apartment complex is, but it won’t give you a clear image of all sides. Case in point: the NASA damage map was created using Sentinel-1 SAR data. In a nutshell, damage assessment in this case is a three-dimensional problem, and remote sensing is a two-dimensional solution.</p>
|
<p>Areas close to the explosion suffered so much damage that it could be seen from above, but even if an apartment building had all of its windows blown out, this would not necessarily be visible in a top-down view. Even for radar, which does technically collect data in three dimensions, the angle problem remains; a high resolution radar might be able to tell you how tall an apartment complex is, but it won’t give you a clear image of all sides. Case in point: the NASA damage map was created using Sentinel-1 SAR data. In a nutshell, damage assessment in this case is a three-dimensional problem, and remote sensing is a two-dimensional solution.</p>
|
||||||
<section id="creating-a-3d-model-of-beirut" class="level3" data-number="10.6.1">
|
<section id="creating-a-3d-model-of-beirut" class="level3">
|
||||||
<h3 data-number="10.6.1" class="anchored" data-anchor-id="creating-a-3d-model-of-beirut"><span class="header-section-number">10.6.1</span> Creating a 3D model of Beirut</h3>
|
<h3 class="anchored" data-anchor-id="creating-a-3d-model-of-beirut">Creating a 3D model of Beirut</h3>
|
||||||
<p>To create a more accurate rendering of directional blast damage, three dimensional data are required. Data from Open Street Maps (OSM) contains information on both the “footprints” (i.e., the location and shape) as well as the height of buildings, which is enough to create a three dimensional model of Beirut. 3D rendering was done in Blender using the Blender-OSM add-on to import a satellite basemap, terrain raster, and OSM data.</p>
|
<p>To create a more accurate rendering of directional blast damage, three dimensional data are required. Data from Open Street Maps (OSM) contains information on both the “footprints” (i.e., the location and shape) as well as the height of buildings, which is enough to create a three dimensional model of Beirut. 3D rendering was done in Blender using the Blender-OSM add-on to import a satellite basemap, terrain raster, and OSM data.</p>
|
||||||
<p>Geolocated videos of the blast can be used to verify and adjust the model. Below is a side-by-side comparison of the twitter video and a 3D rendition of OSM data:</p>
|
<p>Geolocated videos of the blast can be used to verify and adjust the model. Below is a side-by-side comparison of the twitter video and a 3D rendition of OSM data:</p>
|
||||||
<p><img src="../images/beirut/IMG_4.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_4.png" class="img-fluid"></p>
|
||||||
<p>Some slight adjustments to the raw OSM data were made to achieve the image on the right. The building footprints are generally very accurate and comprehensive in coverage, but the building height data does occasionally have to be adjusted manually. A simple and reliable way of doing this is to look at the shadows cast by the building on the satellite base map and scale accordingly. I also added a rough texture to the buildings to help differentiate them, and added the domed roof of the Greek Orthodox church for reference.</p>
|
<p>Some slight adjustments to the raw OSM data were made to achieve the image on the right. The building footprints are generally very accurate and comprehensive in coverage, but the building height data does occasionally have to be adjusted manually. A simple and reliable way of doing this is to look at the shadows cast by the building on the satellite base map and scale accordingly. I also added a rough texture to the buildings to help differentiate them, and added the domed roof of the Greek Orthodox church for reference.</p>
|
||||||
<p>For good measure, a second video is geolocated following the same procedure:</p>
|
<p>For good measure, a second video is geolocated following the same procedure:</p>
|
||||||
<blockquote class="twitter-tweet blockquote">
|
<blockquote class="twitter-tweet blockquote">
|
||||||
@@ -654,32 +642,32 @@ Another view of the explosions in Beirut <a href="https://t.co/efT5VlpMkj">pic.t
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||||
<p>The second pier (highlighted in green) and the angle (in blue) serve as references:</p>
|
<p>The second pier (highlighted in green) and the angle (in blue) serve as references:</p>
|
||||||
<p><img src="../images/beirut/IMG_5.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_5.png" class="img-fluid"></p>
|
||||||
<p>The video was taken from the rooftop of a Japanese restaurant called Clap Beirut (in red above). This is confirmed by a picture of the rooftop bar on google images, which matches the bar that can be seen at 0:02 in the twitter video. Below is a comparison of the video view and the 3D OSM model:</p>
|
<p>The video was taken from the rooftop of a Japanese restaurant called Clap Beirut (in red above). This is confirmed by a picture of the rooftop bar on google images, which matches the bar that can be seen at 0:02 in the twitter video. Below is a comparison of the video view and the 3D OSM model:</p>
|
||||||
<p><img src="../images/beirut/IMG_6.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_6.png" class="img-fluid"></p>
|
||||||
<p>Though somewhat grainy, the basemap on the OSM rendering shows the same parking lot in the foreground, the second pier, and the same two buildings highlighted in yellow. Having created a 3D model of Beirut using OSM data, we can now simulate how the explosion would interact with the cityscape.</p>
|
<p>Though somewhat grainy, the basemap on the OSM rendering shows the same parking lot in the foreground, the second pier, and the same two buildings highlighted in yellow. Having created a 3D model of Beirut using OSM data, we can now simulate how the explosion would interact with the cityscape.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="using-a-viewshed-analysis-to-assess-blast-exposure" class="level3" data-number="10.6.2">
|
<section id="using-a-viewshed-analysis-to-assess-blast-exposure" class="level3">
|
||||||
<h3 data-number="10.6.2" class="anchored" data-anchor-id="using-a-viewshed-analysis-to-assess-blast-exposure"><span class="header-section-number">10.6.2</span> Using a Viewshed Analysis to Assess Blast Exposure</h3>
|
<h3 class="anchored" data-anchor-id="using-a-viewshed-analysis-to-assess-blast-exposure">Using a Viewshed Analysis to Assess Blast Exposure</h3>
|
||||||
<p>As the pressure wave moved through the Beirut, some buildings bore the full force of the explosion, while others were partially shielded by taller structures. A viewshed analysis can be conducted to identify surfaces that were directly exposed to the explosion by creating a lighting object at ground zero; areas that are lit up experienced unobstructed exposure to the blast:</p>
|
<p>As the pressure wave moved through the Beirut, some buildings bore the full force of the explosion, while others were partially shielded by taller structures. A viewshed analysis can be conducted to identify surfaces that were directly exposed to the explosion by creating a lighting object at ground zero; areas that are lit up experienced unobstructed exposure to the blast:</p>
|
||||||
<p><img src="../images/beirut/GIF_1.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_1.gif" class="img-fluid"></p>
|
||||||
<p>Pressure waves, like sound, are capable of diffraction (bending around small obstructions). To roughly simulate this, the lighting object is gradually raised, allowing the light to pass “around” obstructions. Warehouses on the Eastern side of the docks, as well as the first row of apartment buildings facing the docks are immediately affected. As the lighting object rises above the warehouse, more areas suffer direct exposure.</p>
|
<p>Pressure waves, like sound, are capable of diffraction (bending around small obstructions). To roughly simulate this, the lighting object is gradually raised, allowing the light to pass “around” obstructions. Warehouses on the Eastern side of the docks, as well as the first row of apartment buildings facing the docks are immediately affected. As the lighting object rises above the warehouse, more areas suffer direct exposure.</p>
|
||||||
<p>Using two lighting objects– a red one at 10 meters and a blue one at 20 meters above the warehouse at ground zero– the intensity of the blast in different areas is highlighted; red areas suffered direct exposure, blue areas suffered partially obstructed exposure, and black areas were indirectly exposed.</p>
|
<p>Using two lighting objects– a red one at 10 meters and a blue one at 20 meters above the warehouse at ground zero– the intensity of the blast in different areas is highlighted; red areas suffered direct exposure, blue areas suffered partially obstructed exposure, and black areas were indirectly exposed.</p>
|
||||||
<p><img src="../images/beirut/IMG_7.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_7.png" class="img-fluid"></p>
|
||||||
<p>In the immediate vicinity of the explosion the large “L” shaped building (Lebanon’s strategic grain reserve) is bright red, and was barely left standing. It absorbed a large amount of the blast, shielding areas behind it and thereby casting a long blue shadow to the West. If one refers back to the satellite damage maps above, there appears to be significantly less damage in the area just West of (“behind”) the grain silo, roughly corresponding to the blue shadow above. While these areas were still heavily damaged, they seem to have suffered less damage than areas of equal distance to the East.</p>
|
<p>In the immediate vicinity of the explosion the large “L” shaped building (Lebanon’s strategic grain reserve) is bright red, and was barely left standing. It absorbed a large amount of the blast, shielding areas behind it and thereby casting a long blue shadow to the West. If one refers back to the satellite damage maps above, there appears to be significantly less damage in the area just West of (“behind”) the grain silo, roughly corresponding to the blue shadow above. While these areas were still heavily damaged, they seem to have suffered less damage than areas of equal distance to the East.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="accounting-for-diffraction" class="level3" data-number="10.6.3">
|
<section id="accounting-for-diffraction" class="level3">
|
||||||
<h3 data-number="10.6.3" class="anchored" data-anchor-id="accounting-for-diffraction"><span class="header-section-number">10.6.3</span> Accounting for Diffraction</h3>
|
<h3 class="anchored" data-anchor-id="accounting-for-diffraction">Accounting for Diffraction</h3>
|
||||||
<p>The viewshed analysis tells us which sides of a building are exposed to the blast, but it’s a pretty rough approximation of the way the pressure wave would respond to obstacles in its path. As previously mentioned, pressure waves behave much like sound waves or waves in water: they bounce off of objects, move around obstructions, and gradually fade.</p>
|
<p>The viewshed analysis tells us which sides of a building are exposed to the blast, but it’s a pretty rough approximation of the way the pressure wave would respond to obstacles in its path. As previously mentioned, pressure waves behave much like sound waves or waves in water: they bounce off of objects, move around obstructions, and gradually fade.</p>
|
||||||
<p>To get a more precise idea of the way in which the blast interacted with the urban environment, we can model the blast as an actual wave using the “dynamic wave” feature in Blender. This effectively involves creating a two-dimensional plane, telling it to behave like water, and simulating an object being dropped into the water. By putting an obstruction in this plane, we can see how the wave responds to it. As an example, the grain silo has been isolated below:</p>
|
<p>To get a more precise idea of the way in which the blast interacted with the urban environment, we can model the blast as an actual wave using the “dynamic wave” feature in Blender. This effectively involves creating a two-dimensional plane, telling it to behave like water, and simulating an object being dropped into the water. By putting an obstruction in this plane, we can see how the wave responds to it. As an example, the grain silo has been isolated below:</p>
|
||||||
<p><img src="../images/beirut/GIF_2.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_2.gif" class="img-fluid"></p>
|
||||||
<p>As the blast hits the side of the silo, it is reflected. Two large waves can be seen traveling to the right: the initial blast wave, and the reflection from the silo which rivals the initial wave in magnitude. To the left, the wave travels around the silo but is significantly weakened.</p>
|
<p>As the blast hits the side of the silo, it is reflected. Two large waves can be seen traveling to the right: the initial blast wave, and the reflection from the silo which rivals the initial wave in magnitude. To the left, the wave travels around the silo but is significantly weakened.</p>
|
||||||
<p>Broadening the focus and adding the rest of the OSM data back in, we can observe how the pressure wave interacted with buildings on the waterfront:</p>
|
<p>Broadening the focus and adding the rest of the OSM data back in, we can observe how the pressure wave interacted with buildings on the waterfront:</p>
|
||||||
<p><img src="../images/beirut/GIF_3.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_3.gif" class="img-fluid"></p>
|
||||||
<p>The warehouses on the docks were omitted to emphasize the interaction between the pressure wave and the waterfront buildings; their light metal structure and low height means they would have caused little reflection anyway. The general pattern of the dynamic wave is consistent with the viewshed, but adds a layer of detail. The blast is reflected off of the silo towards the East, leading to a double hit. Though the wave still moves around the silo to the West, the pressure is diminished. Once the wave hits the highrises, the pattern becomes noisy as the wave both presses forward into the mainland and is reflected back towards the pier.</p>
|
<p>The warehouses on the docks were omitted to emphasize the interaction between the pressure wave and the waterfront buildings; their light metal structure and low height means they would have caused little reflection anyway. The general pattern of the dynamic wave is consistent with the viewshed, but adds a layer of detail. The blast is reflected off of the silo towards the East, leading to a double hit. Though the wave still moves around the silo to the West, the pressure is diminished. Once the wave hits the highrises, the pattern becomes noisy as the wave both presses forward into the mainland and is reflected back towards the pier.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="modeling-the-pressure-wave" class="level3" data-number="10.6.4">
|
<section id="modeling-the-pressure-wave" class="level3">
|
||||||
<h3 data-number="10.6.4" class="anchored" data-anchor-id="modeling-the-pressure-wave"><span class="header-section-number">10.6.4</span> Modeling the Pressure Wave</h3>
|
<h3 class="anchored" data-anchor-id="modeling-the-pressure-wave">Modeling the Pressure Wave</h3>
|
||||||
<p>Now that we’ve accounted for the directionality of the blast and the influence of buildings, we can model the pressure wave itself. An expanding sphere centered at ground zero is used to model the progression of the pressure wave through the city. To get a visual sense of the blast’s force, the color of the sphere will be a function of the pressure exerted by the pressure wave.</p>
|
<p>Now that we’ve accounted for the directionality of the blast and the influence of buildings, we can model the pressure wave itself. An expanding sphere centered at ground zero is used to model the progression of the pressure wave through the city. To get a visual sense of the blast’s force, the color of the sphere will be a function of the pressure exerted by the pressure wave.</p>
|
||||||
<p>The pressure exerted by the explosion in kilopascals (kPa) at various distances can be calculated using the U.S. Department of Defemse’s Blast Effects Computer, which allows users to input variables such as the TNT equivalent of the ordnance, storage method, and elevation. Though there are several estimates, the blast was likely equivalent to around 300 tons of TNT. The direct “incident pressure” of the pressure wave is shown in blue. However, pressure waves from explosions that occur on the ground are reflected upwards, amplifying the total pressure exerted by the blast. This “reflected pressure” is shown in orange:</p>
|
<p>The pressure exerted by the explosion in kilopascals (kPa) at various distances can be calculated using the U.S. Department of Defemse’s Blast Effects Computer, which allows users to input variables such as the TNT equivalent of the ordnance, storage method, and elevation. Though there are several estimates, the blast was likely equivalent to around 300 tons of TNT. The direct “incident pressure” of the pressure wave is shown in blue. However, pressure waves from explosions that occur on the ground are reflected upwards, amplifying the total pressure exerted by the blast. This “reflected pressure” is shown in orange:</p>
|
||||||
<iframe title="Blast Overpressure and Distance " aria-label="Interactive line chart" id="datawrapper-chart-J1Pb1" src="https://datawrapper.dwcdn.net/J1Pb1/1/" scrolling="no" frameborder="0" style="width: 0; min-width: 100% !important; border: none;" height="400">
|
<iframe title="Blast Overpressure and Distance " aria-label="Interactive line chart" id="datawrapper-chart-J1Pb1" src="https://datawrapper.dwcdn.net/J1Pb1/1/" scrolling="no" frameborder="0" style="width: 0; min-width: 100% !important; border: none;" height="400">
|
||||||
@@ -688,26 +676,26 @@ Another view of the explosions in Beirut <a href="https://t.co/efT5VlpMkj">pic.t
|
|||||||
</script>
|
</script>
|
||||||
<p>For reference, 137 kPa results in 99% fatalities, 68 kPa is enough to cause structural damage to most buildings, and 20 kPa results in serious injuries. 1-6 kPa is enough to break an average window. At 1km, the reflected pressure of the blast (18 kPa) was still enough to seriously injure. Precisely calculating the force exerted by an explosion is exceptionally complicated, however, so these numbers should be treated as rough estimates. Further analysis of the damage caused by the blast can be derived from the UN’s Explosion Consequences Analysis calculator which provides distance values for different types of damage and injuries.</p>
|
<p>For reference, 137 kPa results in 99% fatalities, 68 kPa is enough to cause structural damage to most buildings, and 20 kPa results in serious injuries. 1-6 kPa is enough to break an average window. At 1km, the reflected pressure of the blast (18 kPa) was still enough to seriously injure. Precisely calculating the force exerted by an explosion is exceptionally complicated, however, so these numbers should be treated as rough estimates. Further analysis of the damage caused by the blast can be derived from the UN’s Explosion Consequences Analysis calculator which provides distance values for different types of damage and injuries.</p>
|
||||||
<p>Linking the values in this graph to the color of the pressure wave sphere provides a visual representation of the blast’s force as it expands. An RGB color scale corresponds to the blast’s overpressure at three threshold values.</p>
|
<p>Linking the values in this graph to the color of the pressure wave sphere provides a visual representation of the blast’s force as it expands. An RGB color scale corresponds to the blast’s overpressure at three threshold values.</p>
|
||||||
<p><img src="../images/beirut/beirut.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/beirut.gif" class="img-fluid"></p>
|
||||||
<p>By keeping the lighting object from the viewshed analysis and placing it within the expanding sphere of the pressure wave, we combine two key pieces of information: the pressure exerted by the blast (the color of the sphere), and the level of directional exposure (brightness).</p>
|
<p>By keeping the lighting object from the viewshed analysis and placing it within the expanding sphere of the pressure wave, we combine two key pieces of information: the pressure exerted by the blast (the color of the sphere), and the level of directional exposure (brightness).</p>
|
||||||
<p>Now, referring back to the two geolocated twitter videos from earlier, we can recreate the blast in our 3D model and get some new insights. Below is a side-by-side comparison of the first video and the 3D model:</p>
|
<p>Now, referring back to the two geolocated twitter videos from earlier, we can recreate the blast in our 3D model and get some new insights. Below is a side-by-side comparison of the first video and the 3D model:</p>
|
||||||
<p><img src="../images/beirut/GIF_5.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_5.gif" class="img-fluid"></p>
|
||||||
<p>Judging by the twitter video alone, it would be very hard to tell the fate of the person filming or the damage caused to the building that they were in. However, the 3D model shows that despite having an unobstructed view of the explosion, the incident pressure of the pressure wave had decreased significantly by the time it reached the viewing point. The blue-green color corresponds to roughly 15 kPa– enough to injure and break windows, but not enough to cause structural damage to the building.</p>
|
<p>Judging by the twitter video alone, it would be very hard to tell the fate of the person filming or the damage caused to the building that they were in. However, the 3D model shows that despite having an unobstructed view of the explosion, the incident pressure of the pressure wave had decreased significantly by the time it reached the viewing point. The blue-green color corresponds to roughly 15 kPa– enough to injure and break windows, but not enough to cause structural damage to the building.</p>
|
||||||
<p>The second twitter video was taken slightly closer to ground zero, but the view was partially obstructed by the grain silo:</p>
|
<p>The second twitter video was taken slightly closer to ground zero, but the view was partially obstructed by the grain silo:</p>
|
||||||
<p><img src="../images/beirut/GIF_6.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_6.gif" class="img-fluid"></p>
|
||||||
<p>Though the pressure wave probably exerted more pressure compared to the first angle, the partial obstruction of the grain silo likely tempered the force of the blast.</p>
|
<p>Though the pressure wave probably exerted more pressure compared to the first angle, the partial obstruction of the grain silo likely tempered the force of the blast.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="assessing-damage-to-the-skyline-tower" class="level3" data-number="10.6.5">
|
<section id="assessing-damage-to-the-skyline-tower" class="level3">
|
||||||
<h3 data-number="10.6.5" class="anchored" data-anchor-id="assessing-damage-to-the-skyline-tower"><span class="header-section-number">10.6.5</span> Assessing Damage to the Skyline Tower</h3>
|
<h3 class="anchored" data-anchor-id="assessing-damage-to-the-skyline-tower">Assessing Damage to the Skyline Tower</h3>
|
||||||
<p>As a concrete example of how this approach can be used to assess damage (or predict it, if one had the foresight), let us consider the Skyline Tower, pictured below following the explosion:</p>
|
<p>As a concrete example of how this approach can be used to assess damage (or predict it, if one had the foresight), let us consider the Skyline Tower, pictured below following the explosion:</p>
|
||||||
<p><img src="../images/beirut/IMG_8.png" class="img-fluid"></p>
|
<p><img src="images/beirut/IMG_8.png" class="img-fluid"></p>
|
||||||
<p>This partial side view shows two faces of the building, labeled “A” and “B” above. Side A was nearly perpendicular to the blast, and just 600m from ground zero. Based on the previous modeling, the pressure wave exerted roughly 40 kPa on this side of the building. The corner where sides A and B meet, highlighted in green, shows total destruction of windows, removal of most siding panels, and structural damage. The back corner, highlighted in red, shows many windows still intact, indicating that the maximum overpressure on this side of the building likely didn’t exceed 10 kPa. In other words, standing on the front balcony would likely have led to serious injury but standing on the back balcony would have been relatively safe.</p>
|
<p>This partial side view shows two faces of the building, labeled “A” and “B” above. Side A was nearly perpendicular to the blast, and just 600m from ground zero. Based on the previous modeling, the pressure wave exerted roughly 40 kPa on this side of the building. The corner where sides A and B meet, highlighted in green, shows total destruction of windows, removal of most siding panels, and structural damage. The back corner, highlighted in red, shows many windows still intact, indicating that the maximum overpressure on this side of the building likely didn’t exceed 10 kPa. In other words, standing on the front balcony would likely have led to serious injury but standing on the back balcony would have been relatively safe.</p>
|
||||||
<p>The animation below shows the Skyline Tower as it is hit by the pressure wave, with sides A and B labeled:</p>
|
<p>The animation below shows the Skyline Tower as it is hit by the pressure wave, with sides A and B labeled:</p>
|
||||||
<p><img src="../images/beirut/GIF_7.gif" class="img-fluid"></p>
|
<p><img src="images/beirut/GIF_7.gif" class="img-fluid"></p>
|
||||||
<p>The bright green color of the pressure wave indicates a strong likelihood of structural damage. Side A can be seen taking a direct hit, while side B is angled slightly away. Despite not being directly exposed to the blast, it likely still took reflective damage from some of the neighboring buildings. Both the incident overpressure indicated by the color of the sphere, as well as the relative brightness of sides A and B both correspond closely to the observed damage taken by the Skyline Tower.</p>
|
<p>The bright green color of the pressure wave indicates a strong likelihood of structural damage. Side A can be seen taking a direct hit, while side B is angled slightly away. Despite not being directly exposed to the blast, it likely still took reflective damage from some of the neighboring buildings. Both the incident overpressure indicated by the color of the sphere, as well as the relative brightness of sides A and B both correspond closely to the observed damage taken by the Skyline Tower.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="further-research" class="level3" data-number="10.6.6">
|
<section id="further-research" class="level3">
|
||||||
<h3 data-number="10.6.6" class="anchored" data-anchor-id="further-research"><span class="header-section-number">10.6.6</span> Further Research</h3>
|
<h3 class="anchored" data-anchor-id="further-research">Further Research</h3>
|
||||||
<p>Though satellite imagery analysis is an indispensable tool in disaster response, it has limitations. Urban blast damage in particular is difficult to assess accurately because it is highly directional and much of it cannot be seen from a bird’s eye view. Using free and open source tools, an interactive 3D model of an urban explosion can be generated, allowing for a highly detailed investigation of directional blast damage. This can be achieved in three steps:</p>
|
<p>Though satellite imagery analysis is an indispensable tool in disaster response, it has limitations. Urban blast damage in particular is difficult to assess accurately because it is highly directional and much of it cannot be seen from a bird’s eye view. Using free and open source tools, an interactive 3D model of an urban explosion can be generated, allowing for a highly detailed investigation of directional blast damage. This can be achieved in three steps:</p>
|
||||||
<p>First, creating a 3D model of the urban area using Blender and Open Street Maps data. Second, conducting a viewshed analysis using lighting objects to gauge levels of unobstructed exposure to the pressure wave. Third, modeling the explosion using geolocated videos of the event and ordnance calculators. For added detail, a dynamic wave analysis can be used to more precisely model how the pressure wave interacts with buildings.</p>
|
<p>First, creating a 3D model of the urban area using Blender and Open Street Maps data. Second, conducting a viewshed analysis using lighting objects to gauge levels of unobstructed exposure to the pressure wave. Third, modeling the explosion using geolocated videos of the event and ordnance calculators. For added detail, a dynamic wave analysis can be used to more precisely model how the pressure wave interacts with buildings.</p>
|
||||||
<p>Once properly modeled, the explosion can be viewed from any angle in the city. The viewshed analysis can be calibrated more finely by ground-truthing various damage levels (e.g. broken windows) at different locations. In the absence of an official address registry in Beirut, OSM is already being used by the Lebanese Red Cross (donate here) to conduct neighborhood surveys assessing blast damage. As such, this type of damage analysis can quickly be integrated into relief efforts, adapted to model disasters in different cities, and can even be used to simulate the destructive potential of hypothetical explosions to promote readiness.</p>
|
<p>Once properly modeled, the explosion can be viewed from any angle in the city. The viewshed analysis can be calibrated more finely by ground-truthing various damage levels (e.g. broken windows) at different locations. In the absence of an official address registry in Beirut, OSM is already being used by the Lebanese Red Cross (donate here) to conduct neighborhood surveys assessing blast damage. As such, this type of damage analysis can quickly be integrated into relief efforts, adapted to model disasters in different cities, and can even be used to simulate the destructive potential of hypothetical explosions to promote readiness.</p>
|
||||||
@@ -1068,12 +1056,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./C2_Refineries.html" class="pagination-link">
|
<a href="./C2_Refineries.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Refinery Identification</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./C4_Ships.html" class="pagination-link">
|
<a href="./C4_Ships.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">Ship Detection</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 11 Ship Detection</title>
|
<title>Remote Sensing for OSINT - Ship Detection</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
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 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 ">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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 show">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link active">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -303,23 +291,23 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#how-it-works" id="toc-how-it-works" class="nav-link active" data-scroll-target="#how-it-works"><span class="header-section-number">11.1</span> How it Works</a></li>
|
<li><a href="#how-it-works" id="toc-how-it-works" class="nav-link active" data-scroll-target="#how-it-works">How it Works</a></li>
|
||||||
<li><a href="#building-the-application" id="toc-building-the-application" class="nav-link" data-scroll-target="#building-the-application"><span class="header-section-number">12</span> Building the Application</a>
|
<li><a href="#building-the-application" id="toc-building-the-application" class="nav-link" data-scroll-target="#building-the-application">Building the Application</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#setup" id="toc-setup" class="nav-link" data-scroll-target="#setup"><span class="header-section-number">12.1</span> Setup</a></li>
|
<li><a href="#setup" id="toc-setup" class="nav-link" data-scroll-target="#setup">Setup</a></li>
|
||||||
<li><a href="#ship-detection" id="toc-ship-detection" class="nav-link" data-scroll-target="#ship-detection"><span class="header-section-number">12.2</span> Ship Detection</a></li>
|
<li><a href="#ship-detection" id="toc-ship-detection" class="nav-link" data-scroll-target="#ship-detection">Ship Detection</a></li>
|
||||||
<li><a href="#visualization" id="toc-visualization" class="nav-link" data-scroll-target="#visualization"><span class="header-section-number">12.3</span> Visualization</a></li>
|
<li><a href="#visualization" id="toc-visualization" class="nav-link" data-scroll-target="#visualization">Visualization</a></li>
|
||||||
<li><a href="#putting-it-all-together" id="toc-putting-it-all-together" class="nav-link" data-scroll-target="#putting-it-all-together"><span class="header-section-number">12.4</span> Putting it all together</a></li>
|
<li><a href="#putting-it-all-together" id="toc-putting-it-all-together" class="nav-link" data-scroll-target="#putting-it-all-together">Putting it all together</a></li>
|
||||||
<li><a href="#building-a-user-interface" id="toc-building-a-user-interface" class="nav-link" data-scroll-target="#building-a-user-interface"><span class="header-section-number">12.5</span> Building a User Interface</a>
|
<li><a href="#building-a-user-interface" id="toc-building-a-user-interface" class="nav-link" data-scroll-target="#building-a-user-interface">Building a User Interface</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#drawing-tools" id="toc-drawing-tools" class="nav-link" data-scroll-target="#drawing-tools"><span class="header-section-number">12.5.1</span> Drawing Tools</a></li>
|
<li><a href="#drawing-tools" id="toc-drawing-tools" class="nav-link" data-scroll-target="#drawing-tools">Drawing Tools</a></li>
|
||||||
<li><a href="#widgets" id="toc-widgets" class="nav-link" data-scroll-target="#widgets"><span class="header-section-number">12.5.2</span> Widgets</a></li>
|
<li><a href="#widgets" id="toc-widgets" class="nav-link" data-scroll-target="#widgets">Widgets</a></li>
|
||||||
<li><a href="#the-control-panel" id="toc-the-control-panel" class="nav-link" data-scroll-target="#the-control-panel"><span class="header-section-number">12.5.3</span> The Control Panel</a></li>
|
<li><a href="#the-control-panel" id="toc-the-control-panel" class="nav-link" data-scroll-target="#the-control-panel">The Control Panel</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#taking-it-for-a-spin" id="toc-taking-it-for-a-spin" class="nav-link" data-scroll-target="#taking-it-for-a-spin"><span class="header-section-number">12.6</span> Taking it for a spin</a>
|
<li><a href="#taking-it-for-a-spin" id="toc-taking-it-for-a-spin" class="nav-link" data-scroll-target="#taking-it-for-a-spin">Taking it for a spin</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#north-korea" id="toc-north-korea" class="nav-link" data-scroll-target="#north-korea"><span class="header-section-number">12.6.1</span> North Korea</a></li>
|
<li><a href="#north-korea" id="toc-north-korea" class="nav-link" data-scroll-target="#north-korea">North Korea</a></li>
|
||||||
<li><a href="#ukraine" id="toc-ukraine" class="nav-link" data-scroll-target="#ukraine"><span class="header-section-number">12.6.2</span> Ukraine</a></li>
|
<li><a href="#ukraine" id="toc-ukraine" class="nav-link" data-scroll-target="#ukraine">Ukraine</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -330,7 +318,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></h1>
|
<h1 class="title"><span class="chapter-title">Ship Detection</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -351,8 +339,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<iframe src="https://ollielballinger.users.earthengine.app/view/shipdetection" width="100%" height="700px">
|
<iframe src="https://ollielballinger.users.earthengine.app/view/shipdetection" width="100%" height="700px">
|
||||||
</iframe>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
<section id="how-it-works" class="level2" data-number="11.1">
|
<section id="how-it-works" class="level2">
|
||||||
<h2 data-number="11.1" class="anchored" data-anchor-id="how-it-works"><span class="header-section-number">11.1</span> How it Works</h2>
|
<h2 class="anchored" data-anchor-id="how-it-works">How it Works</h2>
|
||||||
<p>The app has two main panels:</p>
|
<p>The app has two main panels:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li>A control panel on the left that allows the user to interact with the application</li>
|
<li>A control panel on the left that allows the user to interact with the application</li>
|
||||||
@@ -365,10 +353,10 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>If you’re closely zoomed in to the map and load imagery from different days by clicking on the graph, you can compare the bright spots on the Sentinel image and the green dots. The ship detection process is pretty accurate, and we typically see one green dot per ship. However, you may notice that we occasionally miss a ship. This is because the ship detection process is based on a threshold, and if the ship is too small it may not generate a high enough return signal to be detected. You can increase the sensitivity of the ship detection process by moving the slider below the graph. This will increase the number of ships detected, but it may also increase the number of false positives.</p>
|
<p>If you’re closely zoomed in to the map and load imagery from different days by clicking on the graph, you can compare the bright spots on the Sentinel image and the green dots. The ship detection process is pretty accurate, and we typically see one green dot per ship. However, you may notice that we occasionally miss a ship. This is because the ship detection process is based on a threshold, and if the ship is too small it may not generate a high enough return signal to be detected. You can increase the sensitivity of the ship detection process by moving the slider below the graph. This will increase the number of ships detected, but it may also increase the number of false positives.</p>
|
||||||
<p>The next section focuses on building this application. After that, we’ll have a look at a few different use cases for this sort of maritime surveillance.</p>
|
<p>The next section focuses on building this application. After that, we’ll have a look at a few different use cases for this sort of maritime surveillance.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="building-the-application" class="level1" data-number="12">
|
<section id="building-the-application" class="level1">
|
||||||
<h1 data-number="12"><span class="header-section-number">12</span> Building the Application</h1>
|
<h1>Building the Application</h1>
|
||||||
<section id="setup" class="level2" data-number="12.1">
|
<section id="setup" class="level2">
|
||||||
<h2 data-number="12.1" class="anchored" data-anchor-id="setup"><span class="header-section-number">12.1</span> Setup</h2>
|
<h2 class="anchored" data-anchor-id="setup">Setup</h2>
|
||||||
<p>The first step is to configure the map and import the necessary datasets. By default, we want the app to be centered on the Suez Canal. Then, we want to import the Digital Surface Model (DSM) from the ALOS World 3D-30 dataset. This dataset provides a 30m resolution elevation model of the Earth which we will use to mask out the land. Finally, we want to import the Sentinel 1 dataset. We will use the VV polarization and the Interferometric Wide (IW) mode. We will also sort the images by date.</p>
|
<p>The first step is to configure the map and import the necessary datasets. By default, we want the app to be centered on the Suez Canal. Then, we want to import the Digital Surface Model (DSM) from the ALOS World 3D-30 dataset. This dataset provides a 30m resolution elevation model of the Earth which we will use to mask out the land. Finally, we want to import the Sentinel 1 dataset. We will use the VV polarization and the Interferometric Wide (IW) mode. We will also sort the images by date.</p>
|
||||||
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Center the map on the Suez Canal and set map options</span></span>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Center the map on the Suez Canal and set map options</span></span>
|
||||||
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setCenter</span>(<span class="fl">32.327</span><span class="op">,</span> <span class="fl">31.4532</span><span class="op">,</span> <span class="dv">10</span>)<span class="op">;</span></span>
|
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="bu">Map</span><span class="op">.</span><span class="fu">setCenter</span>(<span class="fl">32.327</span><span class="op">,</span> <span class="fl">31.4532</span><span class="op">,</span> <span class="dv">10</span>)<span class="op">;</span></span>
|
||||||
@@ -399,8 +387,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a>])<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a>])<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>Now that we’ve gotten that out of the way, we can move on to the actual detection of ships.</p>
|
<p>Now that we’ve gotten that out of the way, we can move on to the actual detection of ships.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="ship-detection" class="level2" data-number="12.2">
|
<section id="ship-detection" class="level2">
|
||||||
<h2 data-number="12.2" class="anchored" data-anchor-id="ship-detection"><span class="header-section-number">12.2</span> Ship Detection</h2>
|
<h2 class="anchored" data-anchor-id="ship-detection">Ship Detection</h2>
|
||||||
<p>You might expect the automatic identification of ships based on synthetic aperture radar satellite imagery to involve a complex machine learning algorithm or artificial intelligence. In fact, it can be done in one line of code which sets a cutoff. If the return signal is greater than 0, then we have a ship. If it’s less than 0, then we don’t. Simple as that.</p>
|
<p>You might expect the automatic identification of ships based on synthetic aperture radar satellite imagery to involve a complex machine learning algorithm or artificial intelligence. In fact, it can be done in one line of code which sets a cutoff. If the return signal is greater than 0, then we have a ship. If it’s less than 0, then we don’t. Simple as that.</p>
|
||||||
<p>The main analytical function responsible for ship identification is the <code>getVectors</code> function shown below. It takes an image as an input and returns a FeatureCollection of points, each corresponding to a ship. The function clips the image to the area of interest, selects the VV polarization, and finally filters out areas where the VV value is smaller than 0. This results in a raster image where the sea is black and the ships are white. We then use the <code>reduceToVectors</code> function to convert the raster image to a FeatureCollection of points. The function returns this FeatureCollection, and sets a property called <code>count</code> which is the number of ships detected in the image.</p>
|
<p>The main analytical function responsible for ship identification is the <code>getVectors</code> function shown below. It takes an image as an input and returns a FeatureCollection of points, each corresponding to a ship. The function clips the image to the area of interest, selects the VV polarization, and finally filters out areas where the VV value is smaller than 0. This results in a raster image where the sea is black and the ships are white. We then use the <code>reduceToVectors</code> function to convert the raster image to a FeatureCollection of points. The function returns this FeatureCollection, and sets a property called <code>count</code> which is the number of ships detected in the image.</p>
|
||||||
<div class="sourceCode" id="cb2"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">getVectors</span>(img) {</span>
|
<div class="sourceCode" id="cb2"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">getVectors</span>(img) {</span>
|
||||||
@@ -432,8 +420,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb2-27"><a href="#cb2-27" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb2-27"><a href="#cb2-27" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>The <code>count</code> and <code>system:time_start</code> properties are used to create the graph of daily ship counts and allow the resulting vector (point) data to interact with the date slider widget. An important detail here is that the “scale” parameter of the <code>reduceToVectors</code> function is set to the value of the scale slider widget. This allows the user to adjust the resolution of the ship detection process; a smaller value will allow us to detect smaller ships.</p>
|
<p>The <code>count</code> and <code>system:time_start</code> properties are used to create the graph of daily ship counts and allow the resulting vector (point) data to interact with the date slider widget. An important detail here is that the “scale” parameter of the <code>reduceToVectors</code> function is set to the value of the scale slider widget. This allows the user to adjust the resolution of the ship detection process; a smaller value will allow us to detect smaller ships.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="visualization" class="level2" data-number="12.3">
|
<section id="visualization" class="level2">
|
||||||
<h2 data-number="12.3" class="anchored" data-anchor-id="visualization"><span class="header-section-number">12.3</span> Visualization</h2>
|
<h2 class="anchored" data-anchor-id="visualization">Visualization</h2>
|
||||||
<p>The <code>viz</code> function is responsible for displaying the results of the ship detection process. It takes the area of interest, the vector data, and the Sentinel 1 image as inputs. Nothing super complicated here; we’re just creating three layers and adding them to the map in order: the underlying Sentinel-1 image raster, the ship vector data in green, and the area of interest outline in red. We’re using the <code>Map.layers().set()</code> function to replace the existing layers with the new ones, rather than adding new ones each time.</p>
|
<p>The <code>viz</code> function is responsible for displaying the results of the ship detection process. It takes the area of interest, the vector data, and the Sentinel 1 image as inputs. Nothing super complicated here; we’re just creating three layers and adding them to the map in order: the underlying Sentinel-1 image raster, the ship vector data in green, and the area of interest outline in red. We’re using the <code>Map.layers().set()</code> function to replace the existing layers with the new ones, rather than adding new ones each time.</p>
|
||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">viz</span>(aoi<span class="op">,</span> vectors<span class="op">,</span> s1Filtered) {</span>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="kw">function</span> <span class="fu">viz</span>(aoi<span class="op">,</span> vectors<span class="op">,</span> s1Filtered) {</span>
|
||||||
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="co">// Create an empty image into which to paint the features, cast to byte.</span></span>
|
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="co">// Create an empty image into which to paint the features, cast to byte.</span></span>
|
||||||
@@ -475,8 +463,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb3-38"><a href="#cb3-38" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb3-38"><a href="#cb3-38" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>We want a function to handle the visualization because there are two different situations in which we’re going to visualize results, and we don’t want to repeat our code. The first situation is when the user draws a new area of interest, moves the date slider or alters the scale. In this case, we want to visualize the results of the ship detection process for the entire year’s worth of Sentinel-1 imagery. The second situation is when the user clicks on the chart to analyze a particular day. In this case, we obviously only want to visualize the results of the ship detection process on that day. With this function, we can simply pass the appropriately filtered versions of the Sentinel-1 image and vector data to the function, and it will visualize the results, rather than having to write the same code twice.</p>
|
<p>We want a function to handle the visualization because there are two different situations in which we’re going to visualize results, and we don’t want to repeat our code. The first situation is when the user draws a new area of interest, moves the date slider or alters the scale. In this case, we want to visualize the results of the ship detection process for the entire year’s worth of Sentinel-1 imagery. The second situation is when the user clicks on the chart to analyze a particular day. In this case, we obviously only want to visualize the results of the ship detection process on that day. With this function, we can simply pass the appropriately filtered versions of the Sentinel-1 image and vector data to the function, and it will visualize the results, rather than having to write the same code twice.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="putting-it-all-together" class="level2" data-number="12.4">
|
<section id="putting-it-all-together" class="level2">
|
||||||
<h2 data-number="12.4" class="anchored" data-anchor-id="putting-it-all-together"><span class="header-section-number">12.4</span> Putting it all together</h2>
|
<h2 class="anchored" data-anchor-id="putting-it-all-together">Putting it all together</h2>
|
||||||
<p>Having defined a few helper functions to handle the visualization and ship detection process, we can now move on to the main function that will perform the analysis. This will be performed by the <code>daterangeVectors</code> function. In a nutshell, it reads the user specified date range from the date slider widget, and filters the Sentinel 1 dataset to only include images within that period. Then, it will loop through each Sentinel-1 image from that year and apply the <code>getVectors</code> function to count the number of ships that fall within the area of interest and generate a dataset of points corresponding to detected ships. We’ll then use the <code>viz</code> function we just defined to visualize all of the ship detections and Sentinel-1 images in the AOI during that year stacked on top of each other. Finally, we’ll create a chart based on the number of ships detected per day, and allow the user to click on the chart to visualize the results for a particular day.</p>
|
<p>Having defined a few helper functions to handle the visualization and ship detection process, we can now move on to the main function that will perform the analysis. This will be performed by the <code>daterangeVectors</code> function. In a nutshell, it reads the user specified date range from the date slider widget, and filters the Sentinel 1 dataset to only include images within that period. Then, it will loop through each Sentinel-1 image from that year and apply the <code>getVectors</code> function to count the number of ships that fall within the area of interest and generate a dataset of points corresponding to detected ships. We’ll then use the <code>viz</code> function we just defined to visualize all of the ship detections and Sentinel-1 images in the AOI during that year stacked on top of each other. Finally, we’ll create a chart based on the number of ships detected per day, and allow the user to click on the chart to visualize the results for a particular day.</p>
|
||||||
<div class="sourceCode" id="cb4"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> daterangeVectors <span class="op">=</span> <span class="kw">function</span> () {</span>
|
<div class="sourceCode" id="cb4"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> daterangeVectors <span class="op">=</span> <span class="kw">function</span> () {</span>
|
||||||
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> </span>
|
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a> </span>
|
||||||
@@ -549,15 +537,15 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a>}<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb5-17"><a href="#cb5-17" aria-hidden="true" tabindex="-1"></a>}<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>The analytical portion of the application is now complete. Now we have to build a user interface that lets us interact with the application.</p>
|
<p>The analytical portion of the application is now complete. Now we have to build a user interface that lets us interact with the application.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="building-a-user-interface" class="level2" data-number="12.5">
|
<section id="building-a-user-interface" class="level2">
|
||||||
<h2 data-number="12.5" class="anchored" data-anchor-id="building-a-user-interface"><span class="header-section-number">12.5</span> Building a User Interface</h2>
|
<h2 class="anchored" data-anchor-id="building-a-user-interface">Building a User Interface</h2>
|
||||||
<p>There are four main steps in the process of creating the User Interface (UI):</p>
|
<p>There are four main steps in the process of creating the User Interface (UI):</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li>Configure the drawing tools that allow the user to draw a polygon on the map.</li>
|
<li>Configure the drawing tools that allow the user to draw a polygon on the map.</li>
|
||||||
<li>Create some widgets</li>
|
<li>Create some widgets</li>
|
||||||
</ol>
|
</ol>
|
||||||
<section id="drawing-tools" class="level3" data-number="12.5.1">
|
<section id="drawing-tools" class="level3">
|
||||||
<h3 data-number="12.5.1" class="anchored" data-anchor-id="drawing-tools"><span class="header-section-number">12.5.1</span> Drawing Tools</h3>
|
<h3 class="anchored" data-anchor-id="drawing-tools">Drawing Tools</h3>
|
||||||
<p>We eventually want to allow the user to draw a polygon on the map, and count the number of ships that fall within it. In order to do so, we need to set up a few functions related to the drawing tools that allow the user to do this. Among other things, we want to make sure that we’re clearing the old geometries so that we’re only ever conducting analysis inside the most recent user-drawn polygon, so we’ll need to clear the old ones. We also want to specify the type of polygon the user can draw, which for ease will be a rectangle (you could change this to the actual “polygon” type if you wanted to draw more complex geometries).</p>
|
<p>We eventually want to allow the user to draw a polygon on the map, and count the number of ships that fall within it. In order to do so, we need to set up a few functions related to the drawing tools that allow the user to do this. Among other things, we want to make sure that we’re clearing the old geometries so that we’re only ever conducting analysis inside the most recent user-drawn polygon, so we’ll need to clear the old ones. We also want to specify the type of polygon the user can draw, which for ease will be a rectangle (you could change this to the actual “polygon” type if you wanted to draw more complex geometries).</p>
|
||||||
<div class="sourceCode" id="cb6"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> drawingTools <span class="op">=</span> <span class="bu">Map</span><span class="op">.</span><span class="fu">drawingTools</span>()<span class="op">;</span></span>
|
<div class="sourceCode" id="cb6"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> drawingTools <span class="op">=</span> <span class="bu">Map</span><span class="op">.</span><span class="fu">drawingTools</span>()<span class="op">;</span></span>
|
||||||
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
|
<span id="cb6-2"><a href="#cb6-2" aria-hidden="true" tabindex="-1"></a></span>
|
||||||
@@ -591,8 +579,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb6-30"><a href="#cb6-30" aria-hidden="true" tabindex="-1"></a> drawingTools<span class="op">.</span><span class="fu">draw</span>()<span class="op">;</span></span>
|
<span id="cb6-30"><a href="#cb6-30" aria-hidden="true" tabindex="-1"></a> drawingTools<span class="op">.</span><span class="fu">draw</span>()<span class="op">;</span></span>
|
||||||
<span id="cb6-31"><a href="#cb6-31" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb6-31"><a href="#cb6-31" aria-hidden="true" tabindex="-1"></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
<section id="widgets" class="level3" data-number="12.5.2">
|
<section id="widgets" class="level3">
|
||||||
<h3 data-number="12.5.2" class="anchored" data-anchor-id="widgets"><span class="header-section-number">12.5.2</span> Widgets</h3>
|
<h3 class="anchored" data-anchor-id="widgets">Widgets</h3>
|
||||||
<p>The control panel will eventually contain a few different widgets that allow the user to interact with the application. We’ll start by creating a button that allows the user to draw a polygon on the map. We’ll also create a slider that allows the user to adjust the size of the ships that are detected (remember, this manipulates the “scale” parameter in the <code>reduceToVectors</code> function used in the detection process). The slider will have an accompanying label that tells the user what it does.</p>
|
<p>The control panel will eventually contain a few different widgets that allow the user to interact with the application. We’ll start by creating a button that allows the user to draw a polygon on the map. We’ll also create a slider that allows the user to adjust the size of the ships that are detected (remember, this manipulates the “scale” parameter in the <code>reduceToVectors</code> function used in the detection process). The slider will have an accompanying label that tells the user what it does.</p>
|
||||||
<div class="sourceCode" id="cb7"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Create a button that allows the user to draw a polygon on the map</span></span>
|
<div class="sourceCode" id="cb7"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co">// Create a button that allows the user to draw a polygon on the map</span></span>
|
||||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> drawButton <span class="op">=</span> ui<span class="op">.</span><span class="fu">Button</span>({</span>
|
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> drawButton <span class="op">=</span> ui<span class="op">.</span><span class="fu">Button</span>({</span>
|
||||||
@@ -639,8 +627,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">style</span><span class="op">:</span> { <span class="dt">width</span><span class="op">:</span> <span class="st">"95%"</span> }<span class="op">,</span></span>
|
<span id="cb8-13"><a href="#cb8-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">style</span><span class="op">:</span> { <span class="dt">width</span><span class="op">:</span> <span class="st">"95%"</span> }<span class="op">,</span></span>
|
||||||
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<span id="cb8-14"><a href="#cb8-14" aria-hidden="true" tabindex="-1"></a>})<span class="op">;</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
</section>
|
</section>
|
||||||
<section id="the-control-panel" class="level3" data-number="12.5.3">
|
<section id="the-control-panel" class="level3">
|
||||||
<h3 data-number="12.5.3" class="anchored" data-anchor-id="the-control-panel"><span class="header-section-number">12.5.3</span> The Control Panel</h3>
|
<h3 class="anchored" data-anchor-id="the-control-panel">The Control Panel</h3>
|
||||||
<p>Now we’re going to assemble all of the widgets we’ve just defined into one panel, alongside some explanatory text. I’m adding a blank label to the panel as a placeholder for the chart, since it will be re-added to the panel every time the user changes the date on the date slider, the AOI, or the scale.</p>
|
<p>Now we’re going to assemble all of the widgets we’ve just defined into one panel, alongside some explanatory text. I’m adding a blank label to the panel as a placeholder for the chart, since it will be re-added to the panel every time the user changes the date on the date slider, the AOI, or the scale.</p>
|
||||||
<div class="sourceCode" id="cb9"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> controlPanel <span class="op">=</span> ui<span class="op">.</span><span class="fu">Panel</span>({</span>
|
<div class="sourceCode" id="cb9"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> controlPanel <span class="op">=</span> ui<span class="op">.</span><span class="fu">Panel</span>({</span>
|
||||||
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">widgets</span><span class="op">:</span> [</span>
|
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">widgets</span><span class="op">:</span> [</span>
|
||||||
@@ -677,10 +665,10 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>And there we have it. A fully functional, all weather, daytime/nighttime ship detection tool that doesn’t rely on AIS data. Let’s play around with it.</p>
|
<p>And there we have it. A fully functional, all weather, daytime/nighttime ship detection tool that doesn’t rely on AIS data. Let’s play around with it.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="taking-it-for-a-spin" class="level2" data-number="12.6">
|
<section id="taking-it-for-a-spin" class="level2">
|
||||||
<h2 data-number="12.6" class="anchored" data-anchor-id="taking-it-for-a-spin"><span class="header-section-number">12.6</span> Taking it for a spin</h2>
|
<h2 class="anchored" data-anchor-id="taking-it-for-a-spin">Taking it for a spin</h2>
|
||||||
<section id="north-korea" class="level3" data-number="12.6.1">
|
<section id="north-korea" class="level3">
|
||||||
<h3 data-number="12.6.1" class="anchored" data-anchor-id="north-korea"><span class="header-section-number">12.6.1</span> North Korea</h3>
|
<h3 class="anchored" data-anchor-id="north-korea">North Korea</h3>
|
||||||
<p>In 2020, North Korea implemented one of the most severe COVID-19 lockdowns in the world including a near-total ban on <a href="https://thediplomat.com/2023/01/north-korea-likely-to-lift-pandemic-border-restrictions-in-2023/">“all cross-border exchanges, including trade, traffic, and tourism”.</a>. Measures have been so severe that the country appears to have experienced a significant <a href="https://foreignpolicy.com/2022/05/16/kim-north-korea-covid-outbreak-pandemic/">famine</a>. Though there were signs that things have gradually returned to normal, information on North Korea’s economy is pretty hard to come by. Ship traffic in and out of the country’s largest port, Nampo, is probably a pretty good indicator of the country’s economic activity.</p>
|
<p>In 2020, North Korea implemented one of the most severe COVID-19 lockdowns in the world including a near-total ban on <a href="https://thediplomat.com/2023/01/north-korea-likely-to-lift-pandemic-border-restrictions-in-2023/">“all cross-border exchanges, including trade, traffic, and tourism”.</a>. Measures have been so severe that the country appears to have experienced a significant <a href="https://foreignpolicy.com/2022/05/16/kim-north-korea-covid-outbreak-pandemic/">famine</a>. Though there were signs that things have gradually returned to normal, information on North Korea’s economy is pretty hard to come by. Ship traffic in and out of the country’s largest port, Nampo, is probably a pretty good indicator of the country’s economic activity.</p>
|
||||||
<p>But we can’t just head on down to Marine Tracker or other services that use AIS data to track ship movements. According to the <a href="https://home.treasury.gov/system/files/126/dprk_vessel_advisory_02232018.pdf">U.S. Treasury</a>, “North Korean-flagged merchant vessels have been known to intentionally disable their AIS transponders to mask their movements. This tactic, whether employed by North Korean-flagged vessels or other vessels involved in trade with North Korea, could conceal the origin or destination of cargo destined for, or originating in, North Korea.” They should know – they’re the ones imposing the sanctions that make it illegal to trade with North Korea.</p>
|
<p>But we can’t just head on down to Marine Tracker or other services that use AIS data to track ship movements. According to the <a href="https://home.treasury.gov/system/files/126/dprk_vessel_advisory_02232018.pdf">U.S. Treasury</a>, “North Korean-flagged merchant vessels have been known to intentionally disable their AIS transponders to mask their movements. This tactic, whether employed by North Korean-flagged vessels or other vessels involved in trade with North Korea, could conceal the origin or destination of cargo destined for, or originating in, North Korea.” They should know – they’re the ones imposing the sanctions that make it illegal to trade with North Korea.</p>
|
||||||
<p>A New York Times <a href="https://www.nytimes.com/2019/07/16/world/asia/north-korea-luxury-goods-sanctions.html">investigation</a> tracked the maritime voyage of luxury Mercedes cars from Germany to North Korea via the Netherlands, China, Japan, South Korea, and Russia. AIS transponders were turned off at several points throughout this journey, and the investigation had to rely on satellite imagery to fill in the gaps.</p>
|
<p>A New York Times <a href="https://www.nytimes.com/2019/07/16/world/asia/north-korea-luxury-goods-sanctions.html">investigation</a> tracked the maritime voyage of luxury Mercedes cars from Germany to North Korea via the Netherlands, China, Japan, South Korea, and Russia. AIS transponders were turned off at several points throughout this journey, and the investigation had to rely on satellite imagery to fill in the gaps.</p>
|
||||||
@@ -688,8 +676,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p><img src="./images/ships_north_korea.jpg" class="img-fluid"></p>
|
<p><img src="./images/ships_north_korea.jpg" class="img-fluid"></p>
|
||||||
<p>Looking at imagery from 2021, we can see ship traffic increasing from nearly zero to around 40 ships per day.</p>
|
<p>Looking at imagery from 2021, we can see ship traffic increasing from nearly zero to around 40 ships per day.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="ukraine" class="level3" data-number="12.6.2">
|
<section id="ukraine" class="level3">
|
||||||
<h3 data-number="12.6.2" class="anchored" data-anchor-id="ukraine"><span class="header-section-number">12.6.2</span> Ukraine</h3>
|
<h3 class="anchored" data-anchor-id="ukraine">Ukraine</h3>
|
||||||
<p>Odessa is Ukraine’s largest port. Following its invasion of Ukraine in February 2022, Russia instituted a naval blockade against Ukrainian ports. The impact of this blockade is clearly visible using the tool we’ve just built:</p>
|
<p>Odessa is Ukraine’s largest port. Following its invasion of Ukraine in February 2022, Russia instituted a naval blockade against Ukrainian ports. The impact of this blockade is clearly visible using the tool we’ve just built:</p>
|
||||||
<p><img src="./images/ships_ukraine.jpg" class="img-fluid"></p>
|
<p><img src="./images/ships_ukraine.jpg" class="img-fluid"></p>
|
||||||
<p>The daily number of ships detected in the port of Odessa dropped from 40 to 50 to 0 to 5 following the invasion, and remained near zero until the blockade was lifted in September 2022.</p>
|
<p>The daily number of ships detected in the port of Odessa dropped from 40 to 50 to 0 to 5 following the invasion, and remained near zero until the blockade was lifted in September 2022.</p>
|
||||||
@@ -1051,12 +1039,12 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./C3_Blast.html" class="pagination-link">
|
<a href="./C3_Blast.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Blast Damage Assessment</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
<a href="./C5_Object_Detection.html" class="pagination-link">
|
<a href="./C5_Object_Detection.html" class="pagination-link">
|
||||||
<span class="nav-page-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span> <i class="bi bi-arrow-right-short"></i>
|
<span class="nav-page-text"><span class="chapter-title">Object Detection</span></span> <i class="bi bi-arrow-right-short"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||||
|
|
||||||
|
|
||||||
<title>Remote Sensing for OSINT - 12 Object Detection</title>
|
<title>Remote Sensing for OSINT - Object Detection</title>
|
||||||
<style>
|
<style>
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
span.smallcaps{font-variant: small-caps;}
|
span.smallcaps{font-variant: small-caps;}
|
||||||
@@ -202,20 +202,17 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./index.html" class="sidebar-item-text sidebar-link">
|
<a href="./index.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Overview</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Overview</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link">
|
<a href="./A2_Remote_Sensing.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Remote Sensing</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">2</span> <span class="chapter-title">Remote Sensing</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link">
|
<a href="./A3_Data_Acquisition.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Data Acquisition</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">3</span> <span class="chapter-title">Data Acquisition</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -231,26 +228,22 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
<ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 ">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link">
|
<a href="./B1_Getting_Started.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Getting Started</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">4</span> <span class="chapter-title">Getting Started</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link">
|
<a href="./B2_Interpreting_Images.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Interpreting Images</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">5</span> <span class="chapter-title">Interpreting Images</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link">
|
<a href="./B3_Image_Series.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Image Series</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">6</span> <span class="chapter-title">Image Series</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link">
|
<a href="./B4_Vectors_Tables.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Vectors and Tables</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">7</span> <span class="chapter-title">Vectors and Tables</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -266,32 +259,27 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
<ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link">
|
<a href="./C1_Lights.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">War at Night</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">8</span> <span class="chapter-title">War at Night</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link">
|
<a href="./C2_Refineries.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Refinery Identification</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">9</span> <span class="chapter-title">Refinery Identification</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link">
|
<a href="./C3_Blast.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Blast Damage Assessment</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">10</span> <span class="chapter-title">Blast Damage Assessment</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link">
|
<a href="./C4_Ships.html" class="sidebar-item-text sidebar-link"><span class="chapter-title">Ship Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidebar-item">
|
<li class="sidebar-item">
|
||||||
<div class="sidebar-item-container">
|
<div class="sidebar-item-container">
|
||||||
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link active">
|
<a href="./C5_Object_Detection.html" class="sidebar-item-text sidebar-link active"><span class="chapter-title">Object Detection</span></a>
|
||||||
<span class="menu-text"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></span></a>
|
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -306,18 +294,18 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<h2 id="toc-title">Table of contents</h2>
|
<h2 id="toc-title">Table of contents</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#object-detection-in-satellite-imagery" id="toc-object-detection-in-satellite-imagery" class="nav-link active" data-scroll-target="#object-detection-in-satellite-imagery"><span class="header-section-number">12.1</span> Object Detection in Satellite Imagery</a>
|
<li><a href="#object-detection-in-satellite-imagery" id="toc-object-detection-in-satellite-imagery" class="nav-link active" data-scroll-target="#object-detection-in-satellite-imagery">Object Detection in Satellite Imagery</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#yolov5" id="toc-yolov5" class="nav-link" data-scroll-target="#yolov5"><span class="header-section-number">12.1.1</span> YOLOv5</a></li>
|
<li><a href="#yolov5" id="toc-yolov5" class="nav-link" data-scroll-target="#yolov5">YOLOv5</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#training" id="toc-training" class="nav-link" data-scroll-target="#training"><span class="header-section-number">12.2</span> Training</a>
|
<li><a href="#training" id="toc-training" class="nav-link" data-scroll-target="#training">Training</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#accuracy-assessment" id="toc-accuracy-assessment" class="nav-link" data-scroll-target="#accuracy-assessment"><span class="header-section-number">12.2.1</span> Accuracy Assessment</a></li>
|
<li><a href="#accuracy-assessment" id="toc-accuracy-assessment" class="nav-link" data-scroll-target="#accuracy-assessment">Accuracy Assessment</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="#inference" id="toc-inference" class="nav-link" data-scroll-target="#inference"><span class="header-section-number">12.3</span> Inference</a>
|
<li><a href="#inference" id="toc-inference" class="nav-link" data-scroll-target="#inference">Inference</a>
|
||||||
<ul class="collapse">
|
<ul class="collapse">
|
||||||
<li><a href="#loading-a-trained-model" id="toc-loading-a-trained-model" class="nav-link" data-scroll-target="#loading-a-trained-model"><span class="header-section-number">12.3.1</span> 1. Loading a trained model</a></li>
|
<li><a href="#loading-a-trained-model" id="toc-loading-a-trained-model" class="nav-link" data-scroll-target="#loading-a-trained-model">1. Loading a trained model</a></li>
|
||||||
<li><a href="#loading-the-input-imagery" id="toc-loading-the-input-imagery" class="nav-link" data-scroll-target="#loading-the-input-imagery"><span class="header-section-number">12.3.2</span> 2. Loading the input imagery</a></li>
|
<li><a href="#loading-the-input-imagery" id="toc-loading-the-input-imagery" class="nav-link" data-scroll-target="#loading-the-input-imagery">2. Loading the input imagery</a></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/C5_Object_Detection.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
<div class="toc-actions"><div><i class="bi bi-github"></i></div><div class="action-links"><p><a href="https://github.com/oballinger/RS4OSINT/edit/main/C5_Object_Detection.qmd" class="toc-action">Edit this page</a></p></div></div></nav>
|
||||||
@@ -327,7 +315,7 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
|
|
||||||
<header id="title-block-header" class="quarto-title-block default">
|
<header id="title-block-header" class="quarto-title-block default">
|
||||||
<div class="quarto-title">
|
<div class="quarto-title">
|
||||||
<h1 class="title"><span class="chapter-number">12</span> <span class="chapter-title">Object Detection</span></h1>
|
<h1 class="title"><span class="chapter-title">Object Detection</span></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@@ -355,13 +343,13 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<div class="column-screen">
|
<div class="column-screen">
|
||||||
<p><img src="images/obj_det2.jpg" class="img-fluid"></p>
|
<p><img src="images/obj_det2.jpg" class="img-fluid"></p>
|
||||||
</div>
|
</div>
|
||||||
<section id="object-detection-in-satellite-imagery" class="level2" data-number="12.1">
|
<section id="object-detection-in-satellite-imagery" class="level2">
|
||||||
<h2 data-number="12.1" class="anchored" data-anchor-id="object-detection-in-satellite-imagery"><span class="header-section-number">12.1</span> Object Detection in Satellite Imagery</h2>
|
<h2 class="anchored" data-anchor-id="object-detection-in-satellite-imagery">Object Detection in Satellite Imagery</h2>
|
||||||
<p>Object detection in satellite imagery has a variety of useful applications.</p>
|
<p>Object detection in satellite imagery has a variety of useful applications.</p>
|
||||||
<p>There’s the needle-in-a-haystack problem of needing to monitor a large area for a small number of objects. Immediately prior to the invasion of Ukraine, for example, a number of articles emerged showing Russian military vehicles and equipment popping up in small clearings in the forest near the border with Ukraine. Many of these deployments were spotted by painstakingly combing through high resolution satellite imagery, looking for things that look like trucks. One problem with this approach is that you need to know roughly where to look. The second, and more serious problem, is that you need to be on the lookout in the first place. Object detection, applied to satellite imagery, can automatically comb through vast areas and identify objects of interest. If planes and trucks start showing up in unexpected places, you’ll know about it.</p>
|
<p>There’s the needle-in-a-haystack problem of needing to monitor a large area for a small number of objects. Immediately prior to the invasion of Ukraine, for example, a number of articles emerged showing Russian military vehicles and equipment popping up in small clearings in the forest near the border with Ukraine. Many of these deployments were spotted by painstakingly combing through high resolution satellite imagery, looking for things that look like trucks. One problem with this approach is that you need to know roughly where to look. The second, and more serious problem, is that you need to be on the lookout in the first place. Object detection, applied to satellite imagery, can automatically comb through vast areas and identify objects of interest. If planes and trucks start showing up in unexpected places, you’ll know about it.</p>
|
||||||
<p>Perhaps you’re not monitoring that large of an area, but you want frequent updates about what’s going on. What sorts of objects (planes, trucks, cars, etc.) are present? How many of each? Where are they located? Instead of having to manually look through new imagery as it becomes available, you could have a model automatically analyze new collections and output a summary.</p>
|
<p>Perhaps you’re not monitoring that large of an area, but you want frequent updates about what’s going on. What sorts of objects (planes, trucks, cars, etc.) are present? How many of each? Where are they located? Instead of having to manually look through new imagery as it becomes available, you could have a model automatically analyze new collections and output a summary.</p>
|
||||||
<section id="yolov5" class="level3" data-number="12.1.1">
|
<section id="yolov5" class="level3">
|
||||||
<h3 data-number="12.1.1" class="anchored" data-anchor-id="yolov5"><span class="header-section-number">12.1.1</span> YOLOv5</h3>
|
<h3 class="anchored" data-anchor-id="yolov5">YOLOv5</h3>
|
||||||
<p>Object detection is a fairly complicated task, and there are a number of different approaches to it. In this tutorial, we’ll be using a model called <strong>YOLOv5</strong>. YOLO stands for <strong>You Only Look Once</strong>, and it’s a model that was developed by <a href="https://pjreddie.com/">Joseph Redmon</a> et. al., and the full paper detailing the model can be found <a href="https://arxiv.org/abs/1506.02640">here</a>.</p>
|
<p>Object detection is a fairly complicated task, and there are a number of different approaches to it. In this tutorial, we’ll be using a model called <strong>YOLOv5</strong>. YOLO stands for <strong>You Only Look Once</strong>, and it’s a model that was developed by <a href="https://pjreddie.com/">Joseph Redmon</a> et. al., and the full paper detailing the model can be found <a href="https://arxiv.org/abs/1506.02640">here</a>.</p>
|
||||||
<p>The YOLOv5 model is a <strong>convolutional neural network</strong> (CNN), which is a type of deep learning model. CNNs are very good at identifying patterns in images, particularly in small regions of images. This is important for object detection, because we want to be able to identify objects even if they’re partially obscured by other objects.</p>
|
<p>The YOLOv5 model is a <strong>convolutional neural network</strong> (CNN), which is a type of deep learning model. CNNs are very good at identifying patterns in images, particularly in small regions of images. This is important for object detection, because we want to be able to identify objects even if they’re partially obscured by other objects.</p>
|
||||||
<p>YOLO works by chopping an image up into a grid, and then predicting the location and size of objects in each grid cell:</p>
|
<p>YOLO works by chopping an image up into a grid, and then predicting the location and size of objects in each grid cell:</p>
|
||||||
@@ -370,8 +358,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>Luckily, we can simply re-train the YOLOv5 model on datasets of labeled satellite imagery. The rest of this tutorial will walk through the process of training YOLOv5 on a custom dataset, and then using it to dynamically identify objects in satellite imagery pulled from Google Earth Engine.</p>
|
<p>Luckily, we can simply re-train the YOLOv5 model on datasets of labeled satellite imagery. The rest of this tutorial will walk through the process of training YOLOv5 on a custom dataset, and then using it to dynamically identify objects in satellite imagery pulled from Google Earth Engine.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="training" class="level2 page-columns page-full" data-number="12.2">
|
<section id="training" class="level2 page-columns page-full">
|
||||||
<h2 data-number="12.2" class="anchored" data-anchor-id="training"><span class="header-section-number">12.2</span> Training</h2>
|
<h2 class="anchored" data-anchor-id="training">Training</h2>
|
||||||
<p>The process of re-training the YOLOv5 model on satellite imagery is fairly straightforward and can be accomplished in just three steps; first, we’re going to clone the YOLOv5 repository which contains the model code and the training scripts. Then, we’ll download a dataset of satellite imagery and labels from Roboflow, and finally, we’ll train the model on that dataset.</p>
|
<p>The process of re-training the YOLOv5 model on satellite imagery is fairly straightforward and can be accomplished in just three steps; first, we’re going to clone the YOLOv5 repository which contains the model code and the training scripts. Then, we’ll download a dataset of satellite imagery and labels from Roboflow, and finally, we’ll train the model on that dataset.</p>
|
||||||
<p>Let’s start by cloning the YOLOv5 repository. Note: we’ll be using a fork of the original repository that I’ve modified to include some pre-trained models that we’ll be using later on.</p>
|
<p>Let’s start by cloning the YOLOv5 repository. Note: we’ll be using a fork of the original repository that I’ve modified to include some pre-trained models that we’ll be using later on.</p>
|
||||||
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>git clone https:<span class="op">//</span>github.com<span class="op">/</span>oballinger<span class="op">/</span>yolov5_RS <span class="co"># clone repo</span></span>
|
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>git clone https:<span class="op">//</span>github.com<span class="op">/</span>oballinger<span class="op">/</span>yolov5_RS <span class="co"># clone repo</span></span>
|
||||||
@@ -397,8 +385,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>Finally, we can train our YOLOv5 model on the dataset we just downloaded in just one line of code:</p>
|
<p>Finally, we can train our YOLOv5 model on the dataset we just downloaded in just one line of code:</p>
|
||||||
<div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>python train.py <span class="op">--</span>data {dataset.location}<span class="op">/</span>data.yaml <span class="op">--</span>batch <span class="dv">32</span> <span class="op">--</span>cache</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
<div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>python train.py <span class="op">--</span>data {dataset.location}<span class="op">/</span>data.yaml <span class="op">--</span>batch <span class="dv">32</span> <span class="op">--</span>cache</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||||
<p>This should take about an hour.</p>
|
<p>This should take about an hour.</p>
|
||||||
<section id="accuracy-assessment" class="level3 page-columns page-full" data-number="12.2.1">
|
<section id="accuracy-assessment" class="level3 page-columns page-full">
|
||||||
<h3 data-number="12.2.1" class="anchored" data-anchor-id="accuracy-assessment"><span class="header-section-number">12.2.1</span> Accuracy Assessment</h3>
|
<h3 class="anchored" data-anchor-id="accuracy-assessment">Accuracy Assessment</h3>
|
||||||
<p>Using Tensorboard, we can log the performance of our model over the course of the training process:</p>
|
<p>Using Tensorboard, we can log the performance of our model over the course of the training process:</p>
|
||||||
<div class="column-page">
|
<div class="column-page">
|
||||||
<iframe src="https://tensorboard.dev/experiment/Yiyl7AsoQcyJ3uw699CR8A/#scalars" width="100%" height="700px">
|
<iframe src="https://tensorboard.dev/experiment/Yiyl7AsoQcyJ3uw699CR8A/#scalars" width="100%" height="700px">
|
||||||
@@ -433,16 +421,16 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
<p>This number is very useful when training a model in several different ways using the same dataset, in order to select the best performing one. It’s not that useful for comparing models trained on different datasets, since the mAP 0.5 is dependent on the number of classes in the dataset and the nature of those classes. For example, in the next section we’ll be using a different model trained on the DOTA dataset which has a mAP 0.5 of around 0.68, largely due to the fact that it has around twice as many classes and many of them are similar to each other.</p>
|
<p>This number is very useful when training a model in several different ways using the same dataset, in order to select the best performing one. It’s not that useful for comparing models trained on different datasets, since the mAP 0.5 is dependent on the number of classes in the dataset and the nature of those classes. For example, in the next section we’ll be using a different model trained on the DOTA dataset which has a mAP 0.5 of around 0.68, largely due to the fact that it has around twice as many classes and many of them are similar to each other.</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section id="inference" class="level2 page-columns page-full" data-number="12.3">
|
<section id="inference" class="level2 page-columns page-full">
|
||||||
<h2 data-number="12.3" class="anchored" data-anchor-id="inference"><span class="header-section-number">12.3</span> Inference</h2>
|
<h2 class="anchored" data-anchor-id="inference">Inference</h2>
|
||||||
<p>Now that we’ve got a trained model, we can use it to conduct object detection on new images. we’ll build a data processing pipeline in three steps by:</p>
|
<p>Now that we’ve got a trained model, we can use it to conduct object detection on new images. we’ll build a data processing pipeline in three steps by:</p>
|
||||||
<ol type="1">
|
<ol type="1">
|
||||||
<li>Loading our trained model</li>
|
<li>Loading our trained model</li>
|
||||||
<li>Creating an interactive map to define the area we want to analyze.</li>
|
<li>Creating an interactive map to define the area we want to analyze.</li>
|
||||||
<li>Defining a function to run object detection within this area.</li>
|
<li>Defining a function to run object detection within this area.</li>
|
||||||
</ol>
|
</ol>
|
||||||
<section id="loading-a-trained-model" class="level3" data-number="12.3.1">
|
<section id="loading-a-trained-model" class="level3">
|
||||||
<h3 data-number="12.3.1" class="anchored" data-anchor-id="loading-a-trained-model"><span class="header-section-number">12.3.1</span> 1. Loading a trained model</h3>
|
<h3 class="anchored" data-anchor-id="loading-a-trained-model">1. Loading a trained model</h3>
|
||||||
<p>During the training process, YOLO is iteratively tweaking the model to try to maximize mAP 0.5. It automatically saves the best version of the model in the following location: <code>YOLOv5_RS/runs/train/exp/weights/best.pt</code>. You can save this file for later use, which I have done in case you just want to use this model without having to train it yourself. I’ve also included several other pre-trained models which you can find in the <code>YOLOv5_RS/weights/</code> directory, including:</p>
|
<p>During the training process, YOLO is iteratively tweaking the model to try to maximize mAP 0.5. It automatically saves the best version of the model in the following location: <code>YOLOv5_RS/runs/train/exp/weights/best.pt</code>. You can save this file for later use, which I have done in case you just want to use this model without having to train it yourself. I’ve also included several other pre-trained models which you can find in the <code>YOLOv5_RS/weights/</code> directory, including:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><code>lowres_ships.pt</code>: the model we just trained on Sentinel-2 imagery.</p></li>
|
<li><p><code>lowres_ships.pt</code>: the model we just trained on Sentinel-2 imagery.</p></li>
|
||||||
@@ -451,8 +439,8 @@ gtag('config', 'G-RK9ZLZQ6GL', { 'anonymize_ip': true});
|
|||||||
</ul>
|
</ul>
|
||||||
<p>So far, we’ve trained a model to detect ships in Sentinel-2 imagery. But to show the versatility of this general approach, the rest of this tutorial will load up the <code>general.pt</code> model, and use it to detect a wide range of aircraft in high resolution imagery.</p>
|
<p>So far, we’ve trained a model to detect ships in Sentinel-2 imagery. But to show the versatility of this general approach, the rest of this tutorial will load up the <code>general.pt</code> model, and use it to detect a wide range of aircraft in high resolution imagery.</p>
|
||||||
</section>
|
</section>
|
||||||
<section id="loading-the-input-imagery" class="level3 page-columns page-full" data-number="12.3.2">
|
<section id="loading-the-input-imagery" class="level3 page-columns page-full">
|
||||||
<h3 data-number="12.3.2" class="anchored" data-anchor-id="loading-the-input-imagery"><span class="header-section-number">12.3.2</span> 2. Loading the input imagery</h3>
|
<h3 class="anchored" data-anchor-id="loading-the-input-imagery">2. Loading the input imagery</h3>
|
||||||
<p>To get started with object detection on satellite imagery using these pre-trained models, we need to define an Area of Interest (AOI) and load satellite imagery. We’ll do this by accessing Google Earth Engine from the Python notebook we’re working in, and creating an interactive map that will let us draw an AOI for analysis.</p>
|
<p>To get started with object detection on satellite imagery using these pre-trained models, we need to define an Area of Interest (AOI) and load satellite imagery. We’ll do this by accessing Google Earth Engine from the Python notebook we’re working in, and creating an interactive map that will let us draw an AOI for analysis.</p>
|
||||||
<p>First, we first need to import a few packages:</p>
|
<p>First, we first need to import a few packages:</p>
|
||||||
<div class="sourceCode" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>pip install geemap <span class="op">-</span>q</span>
|
<div class="sourceCode" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="op">!</span>pip install geemap <span class="op">-</span>q</span>
|
||||||
@@ -572,7 +560,7 @@ Once you've done this, you can run the following line of code to automatically i
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
@@ -933,7 +921,7 @@ window.document.addEventListener("DOMContentLoaded", function (event) {
|
|||||||
<nav class="page-navigation">
|
<nav class="page-navigation">
|
||||||
<div class="nav-page nav-page-previous">
|
<div class="nav-page nav-page-previous">
|
||||||
<a href="./C4_Ships.html" class="pagination-link">
|
<a href="./C4_Ships.html" class="pagination-link">
|
||||||
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">11</span> <span class="chapter-title">Ship Detection</span></span>
|
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-title">Ship Detection</span></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-page nav-page-next">
|
<div class="nav-page nav-page-next">
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ Once you've done this, you can run the following line of code to automatically i
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
BIN
images/.DS_Store
vendored
BIN
images/.DS_Store
vendored
Binary file not shown.
BIN
revisit_chart.png
Normal file
BIN
revisit_chart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Reference in New Issue
Block a user