Every map of a river basin is an argument: rain falling here, and not there, ends in this river. Watershed delineation is the computation that draws the boundary of that argument from a terrain model, and in QGIS it is not a single tool but a pipeline, a sequence of operations in which each stage hands the next a cleaner version of the truth. Get the sequence right and the basin that emerges is defensible. Skip a stage and the pipeline still runs, cheerfully, into a basin that is wrong in ways only a field visit would catch. This guide runs the whole pipeline with the two engines QGIS carries for it, GRASS and SAGA, and teaches the checks that tell a good delineation from a confident one.
Home / GIS and Open Map Data for Beginners
Watershed Delineation in QGIS: From a DEM to a Basin Boundary

Photo: Nick Bulanov / Pexels
From Rain to River: The Watershed Checklist
Check off each step as you finish it. Your progress stays on this page.
0 of 7 complete
0% done
Step Zero: A DEM in Meters
Before any hydrology: the elevation model must be in a projected CRS with meter units. Flow algorithms measure slopes and distances cell by cell, and a DEM in degrees makes both meaningless, the same foundation rule as the viewshed pipeline and for the same reason. Reproject first (the mechanics live in our reprojecting guide), choose a DEM resolution matched to the basin, tens of meters for regional work, finer for small catchments, and clip generously beyond the basin you expect: the boundary you are computing must be allowed to surprise you, and a clip that hugs the expected line rigs the result.
Step One: Condition the DEM
Raw DEMs contain sinks: cells or pits lower than everything around them, where computed water pools and stops. Some sinks are real (quarries, karst, endorheic basins) and most, in ordinary terrain, are artifacts of the data, bridges over streams read as dams, noise read as pits. Hydrology pipelines fill or breach them before routing flow, because an unfilled artifact sink amputates the basin upstream of it.
The engines offer their instruments: GRASS's r.fill.dir fills depressions and produces a flow direction grid in the same pass. SAGA's Fill sinks (Wang and Liu) is the standard alternative, a widely used algorithm that fills while preserving downhill gradients as far as the data allows. Either is defensible; what is not defensible is skipping the step and then wondering why the accumulation grid shows a river dying in a field. Note what you did in the project log: filled DEMs are derived data, and the filling choice is part of the result's provenance.
Step Two: Flow Direction and Accumulation
With a conditioned DEM, compute where water goes. GRASS's r.watershed is the workhorse: from the elevation grid it derives flow direction (each cell's downhill neighbor) and flow accumulation (how many cells drain through each cell), plus stream networks and basin subdivisions at thresholds you set. SAGA's counterpart is Catchment Area, computed with a routing method chosen from several, D8 among five: D8 sends each cell's flow to its single steepest neighbor, simple and sharp, while multiple-flow methods spread water across downslope cells and suit gentle terrain and soil work better. The choice is a modeling decision, not a preference: steep, channelized country reads honestly in D8; broad, flat catchments lie in it.
Read the accumulation grid first, before delineating anything: it is the pipeline's self-portrait. Rivers should appear where rivers are, bright threads thickening downstream, and a thread that runs along a road embankment or dies at the DEM's edge is the pipeline telling you about the data, early, while telling is cheap. A worked scale check keeps the numbers honest: at 30 meter resolution, each cell is 900 square meters, so a cell accumulating 10,000 cells drains 9 square kilometers; if the stream at that point plainly drains a valley of 2, the threshold, the DEM, or your arithmetic wants a second look, and the arithmetic is the cheapest of the three to recheck.

Step Three: The Outlet and the Basin
Delineation proper is almost anticlimactic after the preparation: give the pipeline an outlet, the point whose upstream is the basin, and it climbs the flow grid and marks every cell that drains there. GRASS's r.water.outlet takes the outlet's coordinates and the flow direction grid and returns the basin raster. SAGA's Watershed Basins works the same logic from the catchment and channel grids. Two disciplines decide whether the anticlimax is triumph or farce:
- Snap the outlet to the stream. Clicked by eye, an outlet lands on a hillside cell beside the channel as easily as in it, and the basin of a hillside cell is a hillside. Place the outlet on a high-accumulation cell, the bright thread itself, zoomed in, and if the tool offers snapping, use it and verify.
- Then polygonize. GRASS's r.to.vect converts the basin raster to a polygon layer, the deliverable every downstream user expects. Check the polygon against the accumulation threads and the DEM's ridges: the boundary should run along high ground and cross streams only at the outlet. A boundary that crosses a bright accumulation thread mid-slope is wrong, and visibly wrong, which is the pipeline's last gift to the careful.
Choosing the Accumulation Threshold: Where Streams Begin
One parameter governs the pipeline's portrait of the drainage network, and beginners leave it at default without knowing it exists: the stream threshold, the accumulation value above which a cell counts as stream. Set it low and the network sprouts tributaries up every hillside, a delta of blue threads claiming channels where a field merely dampens. Set it high and only the trunk streams survive, the headwater creeks where erosion and ecology actually begin erased from the map. The honest way to set it is empirical: overlay the derived network on the best hydrography you have, a surveyed stream layer, aerial imagery, the blue lines of the topo sheet, and tune the threshold until the derived streams begin where the real ones do, in your terrain, at your DEM's resolution. There is no universal number, because the threshold encodes a claim about the landscape, how much upslope area it takes to carve and keep a channel, and that claim differs between the wet hills and the dry plains by orders of magnitude. Record the threshold in the project log beside the fill and routing choices: three numbers that, together, are the difference between a delineation another analyst can reproduce and one they can only admire.
Nested Basins and the Sub-Basin Habit
Real projects rarely want one basin; they want the basin and its anatomy. Both engines support the subdivision: GRASS's r.watershed emits sub-basins directly at its threshold, and SAGA's basin tools delineate for many outlets at once, every confluence a potential outlet, producing the nested set, tributary basins inside the main stem's, like measuring cups in a drawer. The nested set is the working form for almost every downstream use: pollutant loads attributed per tributary, sampling sites assigned their true contributing areas, restoration prioritized by which sub-basin's numbers move the main stem's. Build the nested set from the start, even when the request names only the whole, because the whole is the union of the parts and the parts are where the explanations live. The dissolve operation is the bridge between the two views: sub-basins dissolved on the main basin's name rebuild the whole from the anatomy, with the counts checked at each step, the pipeline's arithmetic audited end to end.
What the Basin Is For
The polygon is rarely the end. It is the zone for the next questions: summarize the rainfall, the land cover, the soils inside it with zonal statistics; clip the dissolved land parcels to it for the ownership picture; hand it to the flood modeler as the contributing area their model assumes. A delineated watershed is infrastructure for other analyses, which is why its provenance, DEM source and resolution, fill method, routing method, outlet placement, belongs in the project record beside it. The basin drawn carelessly propagates quietly into every product built on it, and the pipeline's checks exist because the boundary looks equally authoritative either way.
Troubleshooting the Classic Failures
The basin is tiny. The outlet is not on the stream, or an unfilled sink upstream of it swallowed the flow. Verify the outlet cell's accumulation value; it should be large.
The basin leaks across a ridge. The DEM's resolution or a road embankment is routing water through the ridge in the model. Finer data, or breaching rather than filling at the crossing, are the honest options; note whichever you choose.
The streams run along roads. The DEM sees the road's crown and ditch as terrain, because they are. Hydro-conditioned DEMs that burn in the real stream network exist for production work; for analysis at guide scale, acknowledge the artifact where it matters.
Two engines, two boundaries. GRASS and SAGA differ in fill and routing details, so their basins differ at the margins. That is not an error; it is the uncertainty of the method made visible, and reporting one boundary with its pipeline named is the professional answer.
Related Guides
If this page answered part of the question, these GIS and open data guides cover the rest of the same ground:
- Viewshed Analysis in QGIS: What a Point Can Actually See: The sibling DEM pipeline: line of sight instead of flow, under the same projected-CRS rule.
- Kriging in QGIS: Interpolation With a Semivariogram, and When IDW Is Enough: Building the rainfall and soil surfaces that watershed work summarizes.
- QGIS Zonal Statistics: Summarize a Raster by Polygon Zones: The standard next step: what the new basin contains, in numbers.
- QGIS Raster Calculator: Band Math, Worked Expressions, and the Nodata Traps: The arithmetic layer underneath raster pipelines, worked expressions included.
Frequently Asked Questions
What are the steps to delineate a watershed in QGIS?
Reproject the DEM to a metric CRS, condition it by filling sinks (GRASS r.fill.dir or SAGA Fill sinks Wang and Liu), compute flow direction and accumulation (r.watershed or SAGA Catchment Area), place an outlet on a high-accumulation cell, delineate its basin (r.water.outlet or Watershed Basins), and polygonize with r.to.vect.
Why does my watershed come out tiny or empty?
Usually the outlet is not on the stream: placed a cell or two off the channel, it drains only a hillside. Check the outlet cell's accumulation value, which should be large, and place the outlet directly on the bright accumulation thread, zoomed in.
What is the difference between D8 and multiple-flow routing?
D8 sends each cell's entire flow to its single steepest downhill neighbor, producing sharp, channelized accumulation that suits steep terrain. Multiple-flow methods distribute flow across downslope neighbors, modeling broad, gentle catchments more honestly. The choice is part of the analysis, not a default.
Why fill sinks in the DEM first?
Because artifact sinks, pits from data noise or bridges read as dams, trap computed flow and amputate the basin upstream. Filling (or breaching) them lets flow reach the outlet. Real sinks exist in karst and endorheic terrain; there, filling is a modeling decision to make deliberately and record.
Should I use GRASS or SAGA for watershed work in QGIS?
Both are sound, and their results differ slightly at the margins because their fill and routing implementations differ. GRASS's r.watershed family is the classic integrated pipeline; SAGA's hydrology module gives finer control over routing methods. Name the engine and settings in your project record either way.
Photo credits: Nick Bulanov (Pexels); Nikolai Lapshin (Pexels). Photos are served from this site; follow the credit to the library page for the original.