Overview
Teaching: 5 min Exercises: 30 minQuestions
How do I track changes in inundated area?
How can I plot inundated area changes in Google Earth Engine?
How do I make that plot interactive?
Objectives
Load Sentinel-1 SAR imagery and classify water pixels
Plot timeseries of number of reservoir surface area
Make plot interactively display classified images
This code plots a timeseries of water surface area in a region and allows the user to click on the plot and display the classified image which produced the selected data point. Water classification is derived from Sentinel-1 Synthetic Aperture Radar (SAR). A new reservoir in the Mekong River Basin is used as an exaple for this problem.
Link to a static version of the full script used in this module: https://code.earthengine.google.com/2530f17708e876ed73cb7945fe2a1b37
This script is structured to make it easy for the user to select different regions or time periods. We are going to use a reservoir in the Mekong River Basin as an example. Note that it looks like there isn’t anything there at first, becasue the dam was constructed very recently (June, 2017)
A major limitation of visible satellite imagery is the presence of clouds. In a region like the Mekong Basin, where it is cloudy during monsoon season, it is very difficult to create a visible timeseries of the earth surface. SAR sensors, like Sentinel-1, use radar waves, which penetrate clouds, allowing us to get a view of the earth surface, even when clouds are present. SAR works by sending a radar signal from the satellite towards the earth at an off nadir angle (i.e. not straight down, but at an angle). The signal hits the earth and scatters and the satellite measures how much backscatter returns to the satellite. The amount of backscatter is determined in part by the roughness of the surface, with smoother surfaces scattering less. Large flat surfaces like water scatter very little and stand out as dark spots against relatively high scattering land surface.
Here we load the Sentinel-1 collection and filter for images of our region taken after 2017. We also filter for type of signal recieved. “VV” stands for vertical transmit, vertical recieved. This means that both the signal transnmited from and recieved by from the satellite is vertically polarized. Some surfaces alter the polarization of the radar signal, but for water body detection, this is usually unused. We only care that all of our images have the same kind of transmit/recieve polarizations.
SAR images typically have speckle noise that degrades the quality of the image. Zoom into some of the water bodies in the image and you will find tiny bright dots. These dots will make it difficult to classify the image as those bright speckles will be classified as land. There are a number of different techniques for dealing with speckles. We are going to use a very simple method, apply a focal median filter. This filter looks at each pixel and its neighboring pixels and takes the median. We then map this focal median process across all images in the collection.
Now we classify the water pixels in the SAR images. We will use a simple threshold approach to identify water. Since water appears darking than land, we will pick a threshold of backscatter and classify all pixels below that threshohld as water. Lets use -16 to give us a ballpark estimate of water area. This threshold is simply based on heuristics, try adjusting the threshold and see how your classification changes. Optimal thesholds can be determined through comparison with a training dataset, or through more robust statstical techniques. For now, we only seek to get an idea of the reservoir surface area patterns, and not the absolute surface area.
Now we want to see a time series of water pixels in our region of interest. We create a chart, which maps a spatial sum reducer across each image in the collection. The sum reducer simply sums all water classification pixels in the region of interest and since all water pixels are set to 1, this gives the total number of water pixels at each time step. Note that the scale is set to 100m instead of 10m (the native resolution of Sentinel-1) in order to speed up the calculation. This means the resulting size of the pixels being counted is 100m pixels, not 10m. This also introduces some error into our calculation. Try setting the scale back to 10m and seeing how much difference this makes (you might have to wait a few minutes).
Your should look something like this and be located in the bottom right of your map area:
We can add functionality to the chart by creating a callback function which actrivates when the user clicks on a data point in the chart. This function then adds the SAR image and the classified water area coresponding to the clicked data point to the map. We also add a label to the map that displays the date of the currently selected image and dynamically updates when a new image is selected.
Now you can click on any point in the chart and the corresponding SAR image and water classification will be added to your map. Click around the chart and explore the reservoir’s operational history. What happened to the reservoir in July, 2018?
Key Points
SAR data can be classified to show changes in inundated area, even in cloudy conditions
Interactive plots can help rapidly explore timeseries imagery.