Skip to content

Commit e78ae2d

Browse files
committed
- added tutorial
- added DSWE Tutorial
1 parent c10a26c commit e78ae2d

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Exploring Dynamic Surface Water Extent (DSWE)
2+
3+
<p style="text-align: right;">
4+
USGS contacts: <a href="mailto:csoulard@usgs.gov">Chris Soulard</a>,
5+
<a href="mailto:jjwalker@usgs.gov">Jessica Walker</a> from
6+
<a href="https://www.usgs.gov">US Geological Survey (USGS)</a>
7+
</p>
8+
9+
Understanding surface water dynamics is crucial for effective water resource management, flood mapping, ecological research, and climate change analysis. The **Dynamic Surface Water Extent (DSWE)** dataset provides reliable, repeatable, and consistent maps of water presence derived from Landsat imagery. Originally introduced by Jones (2015), DSWE has been continuously improved and now leverages the power of Google Earth Engine (GEE) to deliver monthly surface water composites.
10+
11+
In this tutorial, we will:
12+
13+
- Access and preprocess Landsat imagery to generate DSWE layers.
14+
- Understand DSWE categorization and confidence levels.
15+
- Visualize monthly DSWE composites.
16+
- Export the data for further analysis.
17+
18+
19+
20+
## Tutorial Outline
21+
22+
#### 1. Accessing and Preparing Landsat Data
23+
24+
DSWE analysis uses Landsat satellite imagery collections, specifically Landsat 4 through Landsat 9, spanning from 1982 to the present. Before applying DSWE methods, imagery must be preprocessed for consistent reflectance and free from cloud contamination.
25+
26+
#### Steps:
27+
28+
- Define your area of interest (AOI) and date range.
29+
- Load Landsat Collection 2 imagery.
30+
- Apply scaling and cloud masking.
31+
- Calculate terrain and solar geometry indices (e.g., hillshade).
32+
33+
Here's the Earth Engine JavaScript code snippet to access and preprocess data:
34+
35+
```javascript
36+
// Define your date range (within Landsat availability)
37+
var startdate = ee.Date('2000-08-01');
38+
var enddate = ee.Date('2000-10-31');
39+
40+
// Define your AOI (user-defined polygon or drawn geometry)
41+
var aoi = ee.Geometry.Polygon([
42+
[-113.285, 40.423],
43+
[-111.318, 40.423],
44+
[-111.318, 41.952],
45+
[-113.285, 41.952],
46+
[-113.285, 40.423]
47+
]);
48+
49+
// Load and preprocess Landsat collections (example for Landsat 8)
50+
var ls8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
51+
.filterBounds(aoi)
52+
.filterDate(startdate, enddate)
53+
.map(function(img) {
54+
var scaled = img.select('SR_B.*').multiply(0.0000275).add(-0.2);
55+
var qaMask = img.select('QA_PIXEL').bitwiseAnd(parseInt('111101', 2)).neq(0);
56+
return scaled.updateMask(qaMask);
57+
});
58+
59+
// Merge multiple collections (if using multiple Landsat sensors)
60+
```
61+
62+
### 2. Generating the DSWE Layer
63+
64+
The DSWE algorithm categorizes surface water presence into classes based on multiple spectral indices and bitwise logical tests derived from Landsat bands. The output is a categorical layer indicating different confidence levels of surface water presence.
65+
66+
#### DSWE Categories:
67+
68+
- `0` - Not water
69+
- `1` - High-confidence water
70+
- `2` - Moderate-confidence water
71+
- `3` - Partial surface water pixel
72+
- `4` - Low-confidence water or wetland
73+
- `9` - Cloud, cloud shadow, or snow
74+
75+
Here's how the categorization is performed in GEE:
76+
77+
```javascript
78+
// DSWE indices calculation (e.g., MNDWI, NDVI, AWEsh)
79+
var calculateIndices = function(img) {
80+
var ndvi = img.normalizedDifference(['SR_B5', 'SR_B4']).rename('ndvi');
81+
var mndwi = img.normalizedDifference(['SR_B3', 'SR_B6']).rename('mndwi');
82+
return img.addBands([ndvi, mndwi]);
83+
};
84+
85+
var indexedCollection = ls8.map(calculateIndices);
86+
87+
// Apply DSWE decision logic (simplified example)
88+
var dsweLayer = indexedCollection.map(function(img) {
89+
var water = img.select('mndwi').gt(0.124).rename('dswe');
90+
return water.set('system:time_start', img.get('system:time_start'));
91+
});
92+
```
93+
94+
95+
#### 3. Creating Monthly DSWE Composites
96+
97+
Monthly composites are useful to provide stable and representative images of surface water extent over time. These composites handle multiple observations and prioritize higher-confidence water pixels.
98+
99+
Here's how you create monthly composites:
100+
101+
```javascript
102+
// Generate monthly composites
103+
var months = ee.List.sequence(0, enddate.difference(startdate, 'month').subtract(1));
104+
var monthlyDSWE = ee.ImageCollection.fromImages(months.map(function(monthOffset) {
105+
var start = startdate.advance(monthOffset, 'month');
106+
var end = start.advance(1, 'month');
107+
var monthly = dsweLayer.filterDate(start, end).max(); // Example using max confidence
108+
return monthly.set('month', start.format('YYYY-MM'));
109+
}));
110+
111+
print('Monthly DSWE Composites:', monthlyDSWE);
112+
```
113+
114+
#### 4. Visualizing DSWE Layers
115+
116+
Visualizing DSWE layers effectively requires clear symbology to distinguish water confidence classes. Below is an example visualization:
117+
118+
```javascript
119+
// DSWE visualization parameters
120+
var dsweViz = {min:0, max:9, palette:['000000', '002ba1', '6287ec', '77b800', 'c1bdb6', 'ffffff']};
121+
122+
// Add the monthly composite layer to the map
123+
Map.centerObject(aoi, 10);
124+
var sampleMonth = monthlyDSWE.first();
125+
Map.addLayer(sampleMonth, dsweViz, 'Monthly DSWE');
126+
```
127+
128+
![image](https://picsur.spatialbytes.work/i/4947dbfe-3fdd-41dd-b838-366b74e96932.jpg)
129+
130+
#### 5. Exporting DSWE Data
131+
132+
DSWE layers can be exported for further GIS analysis or research applications:
133+
134+
```javascript
135+
Export.image.toDrive({
136+
image: sampleMonth,
137+
description: 'DSWE_Monthly_Composite',
138+
folder: 'EarthEngineExports',
139+
scale: 30,
140+
region: aoi,
141+
crs: 'EPSG:5070',
142+
maxPixels: 1e13
143+
});
144+
```
145+
146+
Here's the Earth Engine code to achieve this. You can find the [full code here]()
147+
148+
#### Conclusion
149+
150+
The DSWE dataset provides an advanced, consistent, and high-resolution approach for analyzing water dynamics from space. This tutorial guides you through accessing, preprocessing, visualizing, and exporting DSWE data using Google Earth Engine, facilitating practical analysis for water resource management, flood detection, and ecological studies.
151+
152+
**Keywords:** Dynamic Surface Water Extent (DSWE), Landsat, Google Earth Engine, Monthly Composites, Surface Water Mapping, Flood Monitoring, Visualization, GIS, Remote Sensing.
153+
154+
155+
156+
#### License
157+
158+
This project is licensed under the Creative Commons Zero v1.0 Universal.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ nav:
486486
- Global Land & Shorelines Masks: tutorials/examples/global_shorelines.md
487487
- Exploring Global 30m Land Cover Change: tutorials/examples/glc_fcs30d_lulc.md
488488
- Population Trends with Landscan: tutorials/examples/landscan_extracts.md
489+
- Exploring Dynamic Surface Water Extent (DSWE): tutorials/examples/dswe_landsat.md
489490
# - Assessing Brazil's Biodiversity and Conservation Needs: tutorials/examples/conservation_priorities.md
490491
# - Forest Loss and Cost Surface Analysis for Brazil's Tall Forests: tutorials/examples/tree_canopy.md
491492
- Changelog:

0 commit comments

Comments
 (0)