Google Earth Engine Tutorial: Download Watershed Boundaries from HydroATLAS
Credit: Youtube Channel “Terra Spatial, Tutorial on downloading watershed boundary data using HydroATLAS dataset for hydrological studies.”
You can see all the tutorials from here: Techgeo Academy.
Google Earth Engine (GEE) is a powerful platform for geospatial analysis, offering access to global datasets and tools for processing satellite imagery. One such dataset is HydroATLAS, which provides watershed boundaries and hydrological features at various resolutions. Below is a step-by-step tutorial on how to download watershed boundaries from HydroATLAS using GEE.
Step 1: Access Google Earth Engine
Log in to your Google Earth Engine account at earthengine.google.com. If you don’t have an account, sign up at signup.google.com for free access.
Step 2: Open the Code Editor
Once logged in, open the Code Editor by clicking on “Code Editor” in the top navigation bar. This is where you’ll write and run your GEE scripts.
Step 3: Load HydroATLAS Dataset
HydroATLAS is not directly available in GEE’s standard data catalog. To access it, you may need to use an external dataset or import it via a custom script. For example, if you have access to a specific asset or dataset, use the following syntax:
var hydroatlas = ee.Image("FAO/HYDROATLAS").select('wshed');
If the dataset isn’t publicly accessible, contact the source or refer to the official HydroATLAS website for access instructions.
Step 4: Define Your Study Area
Use a geometry (e.g., a polygon, point, or a predefined region) to select the area of interest. For example:
var geometry = ee.Geometry.Rectangle([xmin, ymin, xmax, ymax]);
Replace [xmin, ymin, xmax, ymax]
with your desired coordinates.
Step 5: Clip the Dataset to Your Area
Clip the HydroATLAS watershed boundaries to your defined geometry:
var clipped = hydroatlas.clip(geometry);
Step 6: Visualize the Watershed Boundaries
Use the Map module to visualize the data:
Map.centerObject(geometry, 6);
Map.addLayer(clipped, {palette: 'blue'}, 'Watershed Boundaries');
Step 7: Export the Dataset
Export the clipped watershed boundaries as a GeoTIFF or other supported format:
Export.image.toDrive({
image: clipped,
description: 'Watershed_Boundaries',
folder: 'GEE_Exports',
fileNamePrefix: 'watershed',
region: geometry,
crs: 'EPSG:4326',
scale: 30,
maxPixels: 1e10
});
Modify parameters like scale
, region
, and fileNamePrefix
as needed.
Step 8: Run the Script
Click the “Run” button in the Code Editor to execute the script. Monitor the progress in the “Tasks” panel and download the exported file once complete.
FAQ
- Is HydroATLAS directly available in Google Earth Engine?
HydroATLAS is not a built-in dataset in GEE. You may need to import it from an external source or use equivalent hydrological datasets like HydroSHEDS. - How do I handle errors related to missing datasets?
Verify the dataset’s availability in GEE’s data catalog or consult the provider’s documentation. If the dataset isn’t accessible, consider using alternative sources like the PRISM or MODIS datasets. - What resolution does HydroATLAS use?
HydroATLAS provides watershed boundaries at varying resolutions, typically ranging from 30m to 250m. Check the dataset’s metadata for precise details. - Can I export the data in a different format?
Yes, GEE supports exports to formats like GeoTIFF, CSV, and KML. Modify theformat
parameter in your export task as required. - Is HydroATLAS licensed for commercial use?
Licensing terms apply to HydroATLAS data. Review the dataset’s official documentation to ensure compliance with your intended use case.