GEE Tutorials

Google Earth Engine Tutorial: Visualize Snow Cover with NDSI

Credit: Youtube Channel “Terra Spatial, Guide on visualizing snow cover using Normalized Difference Snow Index from Landsat 8 imagery.”

You can see all the tutorials from here: Techgeo Academy.

Introduction to NDSI for Snow Cover Visualization

Normalized Difference Snow Index (NDSI) is a remote sensing technique used to detect snow cover in satellite imagery. It leverages the reflectance properties of snow in the green and shortwave-infrared (SWIR) bands. In Google Earth Engine (GEE), you can compute and visualize NDSI to analyze snow distribution over a region. This tutorial explains how to use GEE to create a snow cover visualization using NDSI.

Prerequisites

To follow this tutorial, ensure you have a Google Earth Engine account and access to the JavaScript API. Familiarity with basic JavaScript and GEE concepts is recommended.

Step 1: Load a Suitable Satellite Dataset

Start by loading a satellite dataset with green and SWIR bands. Landsat 8 data is commonly used for snow cover analysis. For example:


var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2');
var image = dataset.filterDate('2023-01-01', '2023-01-31')
.filter(ee.Filter.eq('WRS_PATH', 30))
.filter(ee.Filter.eq('WRS_ROW', 24))
.first();

Step 2: Calculate NDSI

Compute NDSI using the formula: (Green – SWIR) / (Green + SWIR). The green band is typically ‘SR_B4’ and SWIR is ‘SR_B6’ in Landsat 8 data. Add this as a new band:


var ndsi = image.select(['SR_B4', 'SR_B6'])
.reduce(ee.Reducer.meta('Green', 'SWIR'))
.expression('(Green - SWIR) / (Green + SWIR)', {'Green': image.select('SR_B4'), 'SWIR': image.select('SR_B6')});

Step 3: Visualize the NDSI Output

Apply a visualization with a color palette to highlight snow-covered areas. The following code sets up a palette with blue for snow and grey for non-snow:


var palette = ['FFFFFF', '0000FF']; // White (non-snow) to Blue (snow)
Map.addLayer(ndsi, {min: -1, max: 1, palette: palette}, 'NDSI Snow Cover');

Step 4: Adjust the Visualization Parameters

Use the ‘min’ and ‘max’ parameters to control the range of values displayed. For example, a threshold of 0.4 or higher typically indicates snow cover. You can also refine the palette to include more colors like cyan or teal for better differentiation:


var snowMask = ndsi.gt(0.4);
Map.addLayer(snowMask, {palette: '0000FF'}, 'Snow Mask');

FAQ

What is NDSI and why is it useful?

NDSI measures the contrast between green and SWIR reflectance to identify snow. It’s effective for distinguishing snow from other surfaces like clouds or water.

Can I use other satellite datasets for NDSI?

Yes. NDSI can be calculated with any dataset that includes green and SWIR bands. Landsat 7, Sentinel-2, or MODIS datasets are also suitable.

How do I change the visualization palette?

Modify the ‘palette’ parameter in the Layer.add() method. For example, use [‘000000′, ’00FF00’] for a green-to-black scale.

Why is my NDSI visualization not showing snow?

Ensure the dataset includes the correct bands (SR_B4 and SR_B6 for Landsat 8). Adjust the ‘min’ and ‘max’ parameters or check for cloud cover interfering with results.

How long does it take to process NDSI in GEE?

Processing time depends on data size and complexity. Simple datasets like Landsat 8 can render in seconds. Large areas or multiple time steps may require optimization with filters or region selection.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *