Hydrological Analysis: Flow Paths and Watersheds
Delineate watersheds and model hydrological flow using Digital Elevation Models in QGIS
Tutorial: Hydrological Analysis - Flow Paths & Watersheds
Master hydrological analysis by delineating watersheds, calculating flow paths, and analyzing drainage networks from Digital Elevation Models.
Learning Objectives
π Learning Path: Objectives β Steps
| Objective | Related Step | Time | Key Outcome |
|---|---|---|---|
| π― Calculate flow direction | Step 1: Flow Direction & Accumulation | 20 min | Flow rasters |
| π― Delineate watersheds | Step 2: Watershed Delineation | 20 min | Watershed polygons |
| π― Extract streams | Step 3: Stream Networks | 20 min | Stream vector network |
| π― Calculate parameters | Step 4: Morphometric Analysis | 20 min | Basin statistics |
| π― Perform modeling | Step 5: Hydrological Modeling | 20 min | Flow paths & analysis |
Workflow Summary
This tutorial follows these key steps:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 1: Flow Direction & Accumulation β
β What: Calculate D8 flow routing algorithm β
β Time: ~20 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 2: Watershed Delineation β
β What: Define drainage basins from outlet points β
β Time: ~20 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 3: Stream Network Extraction β
β What: Generate stream vectors from flow accum. β
β Time: ~20 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 4: Morphometric Analysis β
β What: Calculate basin shape and characteristics β
β Time: ~20 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β STEP 5: Hydrological Modeling β
β What: Model water movement and flood risk β
β Time: ~20 min β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RESULT: Complete hydrological analysis package β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Prerequisites & Requirements
Data & Resources
What you need:
| Resource | Type | Purpose |
|---|---|---|
| DEM (sinks filled) | GeoTIFF raster | Input for flow calculations |
| Outlet point | Vector shapefile | Pour point for watershed |
| Study area boundary | Vector shapefile | For clipping outputs |
| QGIS SAGA Tools | Plugin | Advanced hydrology functions |
Optional software: - TauDEM β Specialized hydrological analysis (free) - WhiteboxTools β Modern watershed analysis (free) - GDAL β Command-line raster tools
Data sources: - USGS National Hydrography Dataset: https://www.usgs.gov/mission/water-resources/ - OpenTopography DEM: https://www.opentopodata.org/ - Local hydrological data: Regional water authorities
Step-by-Step Instructions
Achieves: β Learning Objective 1: Calculate flow direction and accumulation
What youβll do: Calculate D8 flow routing to determine how water moves across the terrain.
1.1 β Understanding Flow Direction (D8 Algorithm)
The D8 (8-direction) algorithm routes water from each cell to one of its 8 neighbors (including diagonals). Water always flows to the lowest neighbor elevation.
1.2 β Fill DEM Sinks (Critical Step!)
First, you must remove βsinksβ β cells where water would be trapped:
QGIS Processing Toolbox
Search for βFill Sinksβ (SAGA):
Configuration:
| Parameter | Setting |
|---|---|
| DEM | dem_clipped.tif |
| Output | dem_filled.tif |
This creates a depression-free DEM where water can flow continuously to outlets.

1.3 β Calculate Flow Direction
QGIS Processing Toolbox
Search for βCatchment Areaβ or βFlow Directionβ (SAGA):
Configuration:
| Parameter | Setting |
|---|---|
| DEM | dem_filled.tif |
| Algorithm | D8 (8-direction) |
| Output | flow_direction.tif |
Flow direction values (1-256): - 1 = East, 2 = Southeast, 4 = South, 8 = Southwest - 16 = West, 32 = Northwest, 64 = North, 128 = Northeast
1.4 β Calculate Flow Accumulation
Flow accumulation counts how many upslope cells drain to each cell. High accumulation = concentrated flow (streams).
QGIS Processing Toolbox
Search for βCatchment Areaβ (SAGA):
Configuration:
| Parameter | Setting |
|---|---|
| DEM | dem_filled.tif |
| Algorithm | D8 |
| Output | flow_accumulation.tif |
Interpreting flow accumulation: - Values 1-10 = hillslopes (dispersed flow) - Values 10-100 = small streams - Values 100-1000 = medium streams - Values >1000 = major rivers

β Back to Learning Objectives
Achieves: β Learning Objective 2: Delineate watersheds and drainage basins
What youβll do: Automatically delineate watershed boundaries based on an outlet point.
2.1 β Prepare Outlet Point
Create or load a shapefile with your watershed outlet point (usually river gauges or points of interest):
Creating Outlet Point
- Create new point shapefile or use existing
- Add field βidβ (integer)
- Digitize pour point location on map
- Save shapefile as
outlet.shp
2.2 β Delineate Watershed
QGIS Processing Toolbox
Search for βWatershed Basinsβ or βSnap Pour Pointsβ (SAGA):
Configuration (Step 1: Snap outlet to flow):
| Parameter | Setting |
|---|---|
| DEM | dem_filled.tif |
| Outlet points | outlet.shp |
| Snap distance | 5 cells |
| Output | outlet_snapped.shp |
This moves your point to the nearest high flow-accumulation cell.
Configuration (Step 2: Delineate basin):
| Parameter | Setting |
|---|---|
| Flow Direction | flow_direction.tif |
| Outlet | outlet_snapped.shp |
| Output Watershed | watershed.tif |
Click Run. QGIS traces all upslope cells that drain to your outlet.
2.3 β Convert Raster to Vector Watershed
Convert watershed raster to polygon for analysis:
QGIS Raster Menu
Raster
β Conversion
β Polygonize
Configuration:
| Parameter | Setting |
|---|---|
| Input raster | watershed.tif |
| Output shapefile | watershed_polygon.shp |
Now you have a vector watershed boundary!
2.4 β Calculate Watershed Area
Add area field to watershed polygon:
QGIS Attributes Table
- Right-click watershed layer β Open Attribute Table
- Click Field Calculator
- Create new field:
area_km2 = $area / 1000000
Your watershed area is now calculated in square kilometers!

β Back to Learning Objectives
Achieves: β Learning Objective 3: Extract and classify stream networks
What youβll do: Extract stream vectors from flow accumulation and classify by order.
3.1 β Threshold Flow Accumulation
Create stream raster by thresholding flow accumulation. Cells above threshold = streams:
QGIS Raster Calculator
streams = IF(flow_accumulation > 100, 1, 0)
Adjust threshold (100) based on your terrain. Lower = more streams. Higher = fewer, larger streams only.
3.2 β Vectorize Streams
Convert stream raster to vector lines:
QGIS Raster Menu
Raster
β Conversion
β Polygonize (or Trace contours)
Or use βThinβ algorithm first to convert 1-cell-wide streams to polylines.
3.3 β Calculate Strahler Stream Order
Stream order classifies streams hierarchically: - Order 1 = headwater streams (no upstream tributaries) - Order 2 = where two Order-1 streams meet - Order N = where two Order-(N-1) streams meet
QGIS Processing Toolbox
Search for βStream Orderβ (SAGA):
Configuration:
| Parameter | Setting |
|---|---|
| Flow Direction | flow_direction.tif |
| Stream Raster | streams.tif |
| Output | stream_order.tif |
3.4 β Extract Order-1 and Order-2 Streams
QGIS Raster Calculator
headwater_streams = IF(stream_order == 1, 1, 0)
primary_streams = IF(stream_order <= 2, 1, 0)
main_channel = IF(stream_order >= 3, 1, 0)
Vectorize each for separate analysis and mapping.

β Back to Learning Objectives
Achieves: β Learning Objective 4: Calculate watershed morphometric parameters
What youβll do: Calculate basin shape, drainage, and hydro-climatic parameters.
4.1 β Morphometric Parameters
Calculate key basin characteristics:
Configuration in QGIS Field Calculator:
# Basin shape parameters
basin_area = $area / 1e6 # kmΒ²
basin_perimeter = $perimeter / 1000 # km
form_factor = basin_area / (basin_lengthΒ²)
circularity_ratio = (4 * Ο * area) / (perimeterΒ²)
# Drainage density
drainage_density = stream_length / basin_area # km/kmΒ²
# Relief parameters
relief_ratio = (max_elev - min_elev) / basin_length
ruggedness = relief_ratio * drainage_density
4.2 β Derive Channel Parameters
From stream network:
QGIS Processing
# For each stream segment:
- Stream length (km)
- Stream order (Strahler)
- Sinuosity = actual_length / straight_distance
- Gradient = elevation_drop / stream_length
- Bifurcation ratio = streams_of_order_n / streams_of_order_(n+1)
4.3 β Interpret Morphometric Results
Basin shape interpretation: - Compact basins (low form factor) = flood peaks concentrated - Elongated basins (high form factor) = flood peaks dispersed - Circular basins (high circularity) = higher flood risk
Drainage density interpretation: - High density (>3 km/kmΒ²) = fine-textured, steep terrain - Low density (<1 km/kmΒ²) = coarse-textured, flat terrain - Varies by geology and climate
4.4 β Create Summary Table
Create attribute table summarizing all parameters:
| Parameter | Unit | Value |
|---|---|---|
| Watershed Area | kmΒ² | 245.3 |
| Perimeter | km | 67.4 |
| Form Factor | β | 0.054 |
| Drainage Density | km/kmΒ² | 1.8 |
| Basin Relief | m | 1,248 |
| Main Channel Length | km | 45.2 |
| Average Slope | Β° | 8.5 |
β Back to Learning Objectives
Achieves: β Learning Objective 5: Perform hydrological analysis and modeling
What youβll do: Model water movement, calculate flood potential, and analyze hydrological response.
5.1 β Upslope Catchment Area
Calculate total upslope area draining to each cell (weighted by flow):
QGIS Processing Toolbox
Search for βCatchment Areaβ (SAGA):
Input: dem_filled.tif
Output: upslope_area.tif
Interpretation: - High values = concentrated discharge zones (stream channels) - Low values = hillslope areas - Used for estimating runoff concentration
5.2 β Topographic Wetness Index (TWI)
TWI predicts soil moisture and saturation (wetness):
QGIS Raster Calculator
TWI = LN(upslope_area / TAN(slope))
TWI interpretation: - Low TWI = dry hillslopes - High TWI = wet riparian areas and stream channels - Used for predicting vegetation and groundwater
5.3 β Stream Power Index (SPI)
SPI indicates erosion potential:
QGIS Raster Calculator
SPI = upslope_area * TAN(slope)
SPI interpretation: - High SPI = strong erosion potential (mountain streams) - Low SPI = deposition areas (floodplains) - Used for landslide and erosion hazard assessment
5.4 β Flood Inundation Modeling (Advanced)
Model flood extent using catchment and slope:
QGIS Raster Calculator
# Flood potential = high accumulation + low slope
flood_risk = IF((flow_accumulation > 500) AND
(slope < 5), 1, 0)
Refine with: - Proximity to streams - Valley width (from plan curvature) - Historical flood data
5.5 β Hydrological Response Classification
Classify basin by runoff characteristics:
Fast-responding basins:
- High drainage density
- Steep slopes
- Compact shape
β Short time to peak, flashy floods
Slow-responding basins:
- Low drainage density
- Gentle slopes
- Elongated shape
β Long time to peak, damped floods

Result & Expected Outcome
What you should have now:
β
Flow direction raster (D8 flow paths)
β
Flow accumulation raster (concentration zones)
β
Watershed polygon (drainage basin boundary)
β
Stream network (vector and classified by order)
β
Morphometric parameters (basin characteristics)
β
Hydrological indices (TWI, SPI, flood risk)
Your complete hydrological analysis package:
hydrological_analysis/
βββ flow_analysis/
β βββ dem_filled.tif
β βββ flow_direction.tif
β βββ flow_accumulation.tif
β βββ upslope_area.tif
βββ watershed/
β βββ watershed.tif
β βββ watershed_polygon.shp
β βββ outlet_snapped.shp
βββ streams/
β βββ streams_raster.tif
β βββ streams_vector.shp
β βββ stream_order.tif
β βββ headwater_streams.shp
β βββ main_channel.shp
βββ morphometrics/
β βββ basin_parameters.csv
β βββ stream_statistics.csv
β βββ basin_summary_table.xlsx
βββ hydro_indices/
β βββ topographic_wetness_index.tif
β βββ stream_power_index.tif
β βββ flow_path_length.tif
β βββ time_to_concentration.tif
βββ hazard_assessment/
βββ flood_potential.tif
βββ landslide_susceptibility.tif
βββ erosion_risk_zones.shp
Applications of your hydrological analysis: - π§ Water resource management & allocation - π Flood risk assessment & mapping - π Environmental flow requirements - π Optimal stream gauge placement - π£ Erosion and sediment transport modeling - π© Wastewater dispersion modeling - ποΈ Infrastructure planning (dams, bridges) - πΏ Riparian restoration planning
Exercises & Challenges
Challenge 1: Advanced β Multi-Outlet Watershed Analysis
π΄ Complex Basin Delineation Advanced
Objective: Delineate multiple nested watersheds and analyze their characteristics.
Your task:
- Create 3 outlet points at different locations in your study area
- Delineate 3 watersheds from these outlets
- Calculate morphometric parameters for each watershed
- Compare basin characteristics and hydrological response
- Identify which basin is most flood-prone based on morphometrics
- Document differences and explain hydrological implications
Hint: Use bifurcation ratios and drainage density as flood risk indicators.
Solution (click to reveal):
Flood risk assessment formula:
flood_risk_index = (drainage_density *
(1 - form_factor) *
average_slope) /
basin_relief
Higher index = higher flood risk
Why each parameter matters: - High drainage_density = rapid runoff concentration - Low form_factor = compact basin = peaked floods - High slope = fast runoff - Low relief = poor water dissipation
Challenge 2: Advanced β Streamflow Routing & Time to Peak
π΄ Flow Path Length & Concentration Time Advanced
Objective: Calculate flow path length and estimate time-to-peak streamflow response.
Your task:
- Create flow path length raster (distance from each cell to outlet)
- Calculate concentration time using Kirpich equation
- Map hydrological response zones (fast vs. slow)
- Determine lag time between rainfall and peak discharge
- Identify critical flow paths contributing most to peak flow
- Compare concentration times across different altitudes
Resources: - Kirpich equation: Tc = 0.0078 * L^0.77 * S^-0.385 (L=path length km, S=slope)
Tips, Tricks & Warnings
π‘ Pro Tips
β οΈ Common Pitfalls
π΄ Critical Warnings
These mistakes can invalidate your entire analysis:
β οΈ Never use geographic coordinates (lat/lon) for hydrological analysis! Flow routing calculates distances and slopes that are meaningless in geographic CRS:
β WRONG: Flow distance in WGS 84 lat/lon = incorrect distances
β
CORRECT: Use projected CRS (UTM or local projection)
Always reproject to projected coordinate system before any flow calculations.
β οΈ Check for data voids and artifacts β SRTM has missing data over water, clouds, and mountains. LiDAR may have classification errors. Always inspect your DEM before hydrology!
β οΈ Validate against field data β Computer models can be wrong! Compare your delineated watershed to: - USGS gauging station locations - Published watershed maps - Ground survey data
Never rely solely on DEM analysis for critical applications (flood risk, water supply design).
References & Further Reading
Questions or Issues?
If you encounter problems:
- Check sink filling β Most hydrology issues trace back to unfilled sinks
- Verify CRS β Confirm youβre using projected coordinates (UTM)
- Inspect DEM β Look for artifacts, voids, or data anomalies
- Compare to USGS data β Validate your streams and watersheds against official data
- Review QGIS documentation β https://docs.qgis.org/
Common issues & solutions:
| Issue | Solution |
|---|---|
| Streams donβt match observed | Lower flow accumulation threshold or fill sinks better |
| Watershed boundary crosses ridge | Wrong outlet point or unfilled sinks β re-snap outlet |
| Flow direction looks random | DEM not filled or wrong CRS (using lat/lon) |
| Morphometrics unrealistic | Check basin area calculation β may need unit conversion |
| TWI has negative values | Normal! Values are log-transformed. Use for relative comparison |
Tutorial Version: 1.0
Last Updated: February 5, 2025
Difficulty: Advanced
Estimated Duration: 100 minutes
Status: β
Complete and tested in QGIS 3.28.0 with SAGA tools
Prerequisites: Completion of βWorking with Terrain Dataβ and βDEM Derivativesβ tutorials recommended. Requires SAGA plugin installed.