askvity

How to Make a Watershed in QGIS?

Published in QGIS Watershed Analysis 6 mins read

Creating a watershed in QGIS involves a series of steps, primarily focused on processing Digital Elevation Model (DEM) data. Here's a step-by-step guide:

1. Obtain DEM Data

  • Source: Acquire DEM data for your area of interest. Common sources include:
  • Format: Download the DEM data, typically in formats like GeoTIFF (.tif).

2. (Optional) Re-project DEM Data

  • Rationale: If your DEM data's Coordinate Reference System (CRS) is unsuitable (e.g., a geographic CRS like WGS 84), re-project it to a projected CRS appropriate for your region (e.g., UTM zone). This minimizes distortion in distance and area calculations.
  • QGIS Steps:
    1. Right-click on the DEM layer in the Layers panel.
    2. Select "Export" -> "Save Features As...".
    3. Choose a format (e.g., GeoTIFF).
    4. Specify a filename and location.
    5. Click on the "CRS" button and select the desired projected CRS.
    6. Click "OK".

3. Fill Sinks (Pit Filling)

  • Rationale: DEMs often contain sinks (pits or depressions), which are artificially low areas. Filling these sinks ensures proper drainage modeling.
  • QGIS Steps (Using SAGA tools):
    1. Navigate to "Processing" -> "Toolbox".
    2. Search for "Fill Sinks (Wang & Liu)". You may need to enable SAGA provider in Processing Options.
    3. Double-click the tool to open its dialog.
    4. Select your DEM layer as the "Elevation" input.
    5. Specify an output file for the filled DEM (e.g., "filled_dem.tif").
    6. Click "Run".

4. Calculate Flow Accumulation

  • Rationale: Flow accumulation determines how much water flows into each cell of the DEM. This is a critical step in identifying stream networks.
  • QGIS Steps (Using SAGA tools):
    1. In the Processing Toolbox, search for "Flow Accumulation (Top-Down)".
    2. Double-click the tool.
    3. Select your filled DEM as the "Elevation" input.
    4. Specify an output file for the flow accumulation raster (e.g., "flow_accumulation.tif").
    5. Click "Run".

5. Create a Stream Network

  • Rationale: The stream network represents the actual streams based on the flow accumulation. A threshold determines which accumulation values are considered part of a stream.
  • QGIS Steps (Using SAGA tools):
    1. In the Processing Toolbox, search for "Strahler Order".
    2. Double-click the tool.
    3. Select your flow accumulation raster as the "Flow Accumulation" input.
    4. Specify an output file for the stream order raster (e.g., "stream_order.tif").
    5. Adjust the "Threshold" value. A higher threshold results in fewer, larger streams. A common starting point is a value that corresponds to a reasonable stream density for your area.
    6. Click "Run".
    7. In the Processing Toolbox, search for "Channel Network".
    8. Double-click the tool.
    9. Select your flow accumulation raster as the "Flow Accumulation" input.
    10. Select the Stream Order raster as your 'Initiation Grid'.
    11. Adjust the 'Threshold' value. The threshold here should match the threshold used in Strahler Order.
    12. Click 'Run'.

6. Convert Stream Network to Vectors

  • Rationale: Convert the raster stream network into vector lines for easier manipulation and analysis.
  • QGIS Steps (Using SAGA tools):
    1. In the Processing Toolbox, search for "Raster Channels to Vector".
    2. Double-click the tool.
    3. Select your channel network raster as the "Channels" input.
    4. Specify an output file for the stream network vector lines (e.g., "stream_network.shp").
    5. Click "Run".

7. Define an Outlet Point

  • Rationale: The outlet point is the location where the watershed's water drains out. This is the key to delineating the specific watershed you want.
  • QGIS Steps:
    1. Create a new point shapefile ("Layer" -> "Create Layer" -> "New Shapefile Layer...").
    2. Choose "Point" as the geometry type. Set the CRS to match your DEM's CRS.
    3. Add a new field for identification (e.g., "Name" with Text data type).
    4. Start editing the new shapefile (right-click on the layer in the Layers panel and select "Toggle Editing").
    5. Use the "Add Point Feature" tool to click on the map at the desired outlet location, ensuring it's on a stream.
    6. Enter attributes for the point (e.g., "Outlet1" for the name).
    7. Stop editing and save the changes (right-click on the layer and select "Toggle Editing").

8. Snap Outlet Point to Stream (Important!)

  • Rationale: The outlet point must lie exactly on a stream line for the watershed delineation to work correctly. If it doesn't, the algorithm may delineate the wrong watershed.
  • QGIS Steps:
    1. In the Processing Toolbox, search for "Snap geometries to layer".
    2. Double click on the tool.
    3. Select your outlet point layer as the "Input Layer."
    4. Select your stream network vector lines as the "Reference Layer."
    5. Adjust the 'Tolerance' if needed. This is the maximum distance the point can move.
    6. Click 'Run.'

9. Extract Coordinates of Outlet Point

  • Rationale: The watershed delineation algorithm needs the coordinates of the outlet point.
  • QGIS Steps:
    1. Open the attribute table of the (snapped) outlet point shapefile (right-click on the layer and select "Open Attribute Table").
    2. Add two new fields: one for the X-coordinate and one for the Y-coordinate.
      • Click the "Open Field Calculator" button.
      • Create a new field named "X" (or "Longitude"). Set the output field type to "Decimal number (real)".
      • In the expression box, type $x.
      • Click "OK".
      • Repeat for the Y-coordinate, naming the field "Y" (or "Latitude") and using the expression $y.
    3. Note down the X and Y coordinates of the outlet point.

10. Delineate the Watershed

  • QGIS Steps (Using SAGA tools):
    1. In the Processing Toolbox, search for "Watershed Basins".
    2. Double-click the tool.
    3. Select your filled DEM as the "Elevation" input.
    4. In the "Outlet Coordinates" section, enter the X-coordinate (Longitude) in "X Coordinate" and Y-coordinate (Latitude) in "Y Coordinate". Important: Make sure to enter these in the correct order.
    5. Specify an output file for the watershed raster (e.g., "watershed.tif").
    6. Click "Run".

11. Convert Watershed Raster to Vector

  • Rationale: Converting the watershed from raster to vector format allows for easier analysis and visualization.
  • QGIS Steps:
    1. In the Processing Toolbox, search for "Polygonize (Raster to Vector)".
    2. Double-click the tool.
    3. Select your watershed raster as the "Input layer".
    4. Specify an output file for the watershed polygon (e.g., "watershed.shp").
    5. Click "Run".

You now have a vector polygon representing the watershed that drains to your defined outlet point. You can further analyze this watershed using other QGIS tools.

Related Articles