How to show XPSWMM 2D max. velocity vector results in QGIS

Mel Meng
4 min readAug 25, 2021

--

Source: Innovyze support portal

The velocity vector shows how the water flows through the surface, it can be a great tool to help understand the causes and impacts of surface flooding when reviewing 2D simulation results.

Although XPSWMM has powerful rendering engine to show the 2D results, from time to time, engineers and communities might need to create maps in GIS software packages to combine other sources information and create customized maps. In this article, we will use QGIS to render the max. flow velocity vectors.

Rendering the velocity in QGIS takes just a few steps,

  1. Export the max. velocity vector as a point shapefile
  2. Add the shapefile and create the symbiology for the vector

Export max. velocity vector

Use the XP2D Utility Interface tool to extract the velocity data from the xmdf file.

Style vector in QGIS

Load the shapefile exported from the previous step into QGIS

  1. double click the layer to open the properties
  2. change the marker type to vector field maker

The velocity vector is represented using polar coordinate system,

  • x: the length
  • angle: the angle

Follow the instructions below set the mapping of the fields and the coordinate system.

You might need to adjust the scale factor so that the lines look OK.

Adding arrow to the end of the vector,

  1. adding a new marker line symbol
  2. specify only show the marker at the end of the link

Change the symbol to arrow,

  1. select simple marker
  2. change it to an arrow

to change the size of the arrow,

  1. select Maker
  2. change the size
  3. apply and view the results (4)

To change the color of the arrow based on the velocity,

  1. change to graduated symbol
  2. change the color
  3. select a color ramp
  4. classify to add the entries (5)

To reuse the style,

For very small grid size, the number of velocity vectors can make it hard to see the arrows when zoomed out. In this case we can apply a random sampling to only show some of the vectors.

First we need to create a new column in the point layer to classify the points into different groups.

  1. enter edit mode
  2. create a new column group
  3. make sure you are updating group
  4. generate random number from 1 to 50 (I need to show 1 out of 50 points, it depends on your actual situation, play with this number)
  5. update the values of group column

Next we are going to filter the layer only showing group 1.

  1. double click the layer to open the properties
  2. go to source and enter the filter of group 1

You can also change the grid size while exporting the vector using the XP2D utility to down sampling the results.

--

--

Mel Meng
Mel Meng

No responses yet