GEE Tutorials

Google Earth Engine Tutorial: Extract Basin Surface Water Data

Credit: Youtube Channel “Terra Spatial, Learn how to extract and visualize basin-specific surface water information from JRC global water data.”

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

Google Earth Engine Tutorial: Extract Basin Surface Water Data

Google Earth Engine (GEE) is a powerful platform for geospatial analysis and environmental monitoring. This tutorial will guide you through the process of extracting surface water data for a specific basin using GEE. By leveraging Earth Engine’s vast dataset and JavaScript API, you can analyze spatial patterns of water bodies efficiently.

Step 1: Access Google Earth Engine

To begin, ensure you have a valid Google account and access to the Earth Engine API. Visit the Google Earth Engine website and register if necessary. Once registered, open the Code Editor to start writing scripts.

Step 2: Load the Dataset

GEE provides multiple datasets for surface water analysis. A commonly used dataset is the Global Surface Water Explorer from the European Commission’s Joint Research Centre (JRC). Load the dataset using the following code:


var water = ee.Image('JRC/GSW1.2/GlobalSurfaceWater');
var seasonality = water.select('seasonality'); // Surface water seasonality
var occurrence = water.select('occurrence'); // Permanent surface water

Step 3: Define the Basin of Interest

Select a basin by importing its geometry. If you have a shapefile or GeoJSON, upload it using the “Assets” panel. Alternatively, define a geometry manually:


var basin = ee.FeatureCollection("FAO/GAUL/2015/level2").filter(ee.Filter.eq('ADM2_NAME', 'Your Basin Name'));

Replace “Your Basin Name” with the actual name of the basin you are analyzing.

Step 4: Extract Surface Water Data

Use the clip method to extract data for the basin. For example:


var basinWater = seasonality.clip(basin);
Map.addLayer(basinWater, {min: 0, max: 100, palette: ['white', 'blue']}, 'Surface Water Seasonality');

This code clips the seasonality dataset to the basin geometry and visualizes it on the map.

Step 5: Analyze and Export Data

To calculate the total surface water area in the basin:


var area = basinWater.reduceRegion({
reducer: ee.Reducer.sum(),
geometry: basin.geometry(),
scale: 30,
maxPixels: 1e9
});
print('Total Surface Water Area (in square meters):', area.get('seasonality'));

For exporting results, use the Export.image function:


Export.image.toDrive({
image: basinWater,
description: 'SurfaceWater_Extraction',
folder: 'GEE_Exports',
fileNamePrefix: 'basin_water',
scale: 30,
region: basin.geometry(),
maxPixels: 1e10
});

Conclusion

By following these steps, you can efficiently extract and analyze surface water data for any basin using Google Earth Engine. This approach is scalable for large regions and can be adapted for different datasets or analysis requirements.

FAQ

How do I access Google Earth Engine datasets?

Use the Earth Engine Code Editor and reference datasets via their unique identifiers, such as ‘JRC/GSW1.2/GlobalSurfaceWater’ for surface water data.

What if I encounter an error in my script?

Check the console for error messages. Common issues include incorrect dataset names, geometry definitions, or insufficient permissions. Use print() statements to debug intermediate results.

Can I use other datasets besides JRC/GSW?

Yes, GEE contains multiple datasets, including MODIS, Landsat, and Sentinel. For example, use ‘LANDSAT/LC08/C01/T1_SR’ for Landsat 8 surface reflectance data.

How long does processing take in GEE?

Processing time depends on data size and computational complexity. Small basins may process instantly, while large datasets could take minutes to hours. Optimize by adjusting scale and region parameters.

What format should I export data as?

Export as GeoTIFF for raster data or CSV for tabular statistics. Use Export.image.toDrive for raster and Export.table.toDrive for attribute data.

Similar Posts

Leave a Reply

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