GEE Tutorials

Google Earth Engine Tutorial: Calculate Lake Elevation with DSM and MODIS

Credit: Youtube Channel “Terra Spatial, Tutorial on calculating lake elevation levels using DSM datasets and MODIS imagery.”

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

Introduction to Lake Elevation Calculation with Google Earth Engine

Google Earth Engine (GEE) is a powerful platform for analyzing geospatial data, including elevation models and satellite imagery. This tutorial demonstrates how to calculate lake elevation using Digital Surface Models (DSM) combined with MODIS data to extract surface information. This approach is particularly useful for monitoring water bodies, assessing hydrological changes, and supporting environmental studies.

Step 1: Import and Load Datasets

To begin, import MODIS and DSM datasets into your GEE script. Use the following code:


// Load MODIS surface reflectance data
var modis = ee.ImageCollection("MODIS/006/MCD43A4");
var modisImage = modis.first();

// Load DSM data (e.g., SRTM or other high-resolution models)
var dsm = ee.Image("USGS/SRTMGL1/SRTMGL1_003");

Step 2: Extract Lake Geometry

Identify the lake’s boundaries. You can either use a pre-defined shapefile or manually define a geometry using coordinates. For example:


// Example: Define a lake geometry (replace with your coordinates)
var lakeGeometry = ee.Geometry.Rectangle([x1, y1, x2, y2]);

Step 3: Clip DSM to the Lake Area

Clip the DSM data to the lake geometry to focus on the area of interest:


var lakeDSM = dsm.clip(lakeGeometry);

Step 4: Calculate Elevation Statistics

Calculate the mean or maximum elevation of the lake using the clipped DSM data:


// Get mean elevation
var meanElevation = lakeDSM.select('elevation').reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: lakeGeometry,
  scale: 30  // Adjust based on DSM resolution
});

// Get maximum elevation
var maxElevation = lakeDSM.select('elevation').reduceRegion({
  reducer: ee.Reducer.max(),
  geometry: lakeGeometry,
  scale: 30
});

print('Mean Lake Elevation:', meanElevation);
print('Maximum Lake Elevation:', maxElevation);

Step 5: Visualize the Results

Use GEE’s visualization tools to display elevation data and verify accuracy:


Map.centerObject(lakeGeometry, 10);
Map.addLayer(lakeDSM, {bands: ['elevation'], min: 0, max: 3000}, 'Lake Elevation');

Step 6: Export the Data (Optional)

Export the calculated elevation values as a CSV or GeoTIFF for further analysis:


Export.table.toDrive({
  collection: ee.FeatureCollection([ee.Feature(lakeGeometry, meanElevation)]),
  description: 'lake_elevation',
  fileFormat: 'CSV'
});

FAQ

What datasets are required for this analysis?

You need a DSM dataset (such as SRTM) for elevation data and MODIS data (Surface Reflectance or Land Cover) to identify or mask the lake area.

How accurate is the elevation calculation with DSM?

The accuracy depends on the DSM’s resolution and quality. SRTM data offers 30-meter resolution, while higher-resolution models like ASTER GDEM can improve precision.

Can this method be applied to other water bodies?

Yes. Replace the lake geometry with any water body’s boundary and adjust parameters as needed.

What if the MODIS data is not correctly aligned with the DSM?

Ensure both datasets are in the same projection and scale. Use the .reproject() method in GEE to align them if necessary.

How do I handle missing data or gaps in the DSM?

Use the .clip() or .mask() functions to exclude invalid pixels, or apply a fill algorithm to address gaps.

Is there a way to automate this process for multiple lakes?

Yes. Use a loop or a FeatureCollection to iterate over multiple geometries, applying the same steps to each lake.

Similar Posts

Leave a Reply

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