Tutorial: Visualise Flow Direction with Arrows

Site: OpenCourseWare for GIS
Course: QGIS Advanced Tutorials
Book: Tutorial: Visualise Flow Direction with Arrows
Printed by: Guest user
Date: Saturday, 27 April 2024, 3:40 AM

1. Introduction

The flow direction layer is a raster layer indicating the direction of the water flow. The directions are encoded into discrete values. Each software does that differently.

With a directional or circular ramp we can visualise the flow direction. Creating the colour ramp and interpreting the water flow is difficult. Therefore, here another, more intuitive visualisation method will be used. In this tutorial you'll learn how to visualise the SAGA flow direction layer with arrows indication the flow direction.

After this tutorial you'll be able to:

  • Convert the SAGA flow direction Raster layer to a mesh (GRIB format)
  • Style the flow direction mesh with arrows
  • Visualis the flow direction in the 3D view

2. Style the background layers

First we're going to style the background layers on top of which we will later visualise the arrows of the flow direction.
1. Start QGIS

2. Add the DEM (dem.tif), flow direction raster (flowdir.sdat) and channels (channels.shp) to the Layers panel. You can drag and drop it from the browser panel or use from the main menu Layer | Add layer | Add raster layer...

3. Deactivate the flowdir layer by unchecking the box.

4. Click to open the Layer Styling panel. Make sure DEM is the active layer. Choose Singleband pseudocolor as renderer. Click on the arrow right of Color ramp and choose Create New Color Ramp.... Choose Catalog: cpt-city and then from Topography select elevation and click OK. Then click Classify. Under Layer rendering Change the Blending mode to Multiply.

5. Click right on DEM in the Layers panel and choose Duplicate Layer.

6. Deactivate DEM by unchecking the box and activate the DEM copy layer.

7. Click right on the DEM copy layer and choose Rename Layer. Rename the layer to Hillshade.

8. In the Layer Styling panel choose Hillshade as renderer. Keep the default settings. Only change under Resampling Zoomed in to Bilinear and Zoomed out to Average. This makes the visualisation of the hillshade smoother.
Hillshade

9. Switch on the DEM layer.

Now you'll see the hillshade blended with the DEM.

10. Now style the channels layer with a blue line colour so the result looks like this:

DEM, hillshade and river


3. Convert SAGA Flow Direction raster to mesh

When you have calculated the flow direction using the SAGA tools from the Processing Toolbox, you can convert it to a mesh format using the Crayfish plugin.

First we're going to install the Crayfish plugin.
1. In the main menu go to Plugins | Manage and Install Plugins...

2. Search for Crafish and install the plugin. Click Close to continue.

3. Open the Processing Toolbox: in the main menu choose Processing | Toolbox.

4. Choose Crayfish | Conversions | SAGA Flow to GRIB

5. Choose flowdir as Input raster and save the output as flowmesh.grb and click Run. Close the dialogue after processing.

GRIB is a mesh format supported by QGIS.

6. Now you can drag the flowmesh.grb layer to the map canvas from the Browser panel. You can recognise the mesh format from the icon before the layer name.

After a while you'll see a yellow rectangle covering the study area. In the next section we're going to style the flow direction mesh layer that we have created now.


4. Styling the flow direction mesh layer

The next step is to style the flow direction mesh layer that we have created.

1. Select the flowmesh layer in the Layers panel and open the Layer styling panel

2. Click to toggle off the contours visualisation.

3. Click to toggle on the vector visualisation. The dialogue should now look like this:

4. Click to go to the vector styling tab.

5. Change the Line width to 0.5 and the Color to blue.

6. Change Arrow Length to Fixed with a Length of 2.

7. Zoom in to explore the result.

That already gives a good impression of the flow direction. We're going to further improve the visualisation

8. In the Layer styling panel check the box Display on User Grid and keep the defaults.

The arrows are now fixed to a grid with 10 by 10 pixels spacing.

You can play with the grid settings, the line width and the arrow length until you find the optimal configuration for your zoom level.

In the next section we'll visualise this with the 3D Map View.


5. Visualise the flow direction arrows in the 3D Map View

Another nice way to visualise the flow direction is in the 3D Map View.

1. In the main menu go to View | New 3D Map View

2. Adjust the size of the window, but don't dock it.

3. Click to configure the 3D Map View.

4. In the 3D Configuration dialogue choose under Terrain for Type DEM (Raster Layer). Choose DEM as Elevation. Keep the other settings as default. Click OK.

5. The 3D scene will now render. Click the scroll button of your mouse and drag it slowly to the bottom of your screen. This will change the view. You can also use the buttons of the compass in the window.

Flow direction 3D