I am trying to display arrows on pipes of a sewer network so their direction is from upstream to downstream edges of the pipes.

I have managed to display those arrows on a polyline layer (which is the pipes) from the properties menu, but their direction seems to always be from Northeast to Southwest, regardless of the upstream and downstream edges.

How do i connect the arrow direction to those edges?

For example in the picture, the pipe between Nodes D11122 and D115 should have the arrow directed the opposite way.

Each pipe has an upstream and a downstream edge. Each edge is connected with a node and their properties are shown in the attribute table.

enter image description here

  • Can you post a picture of what you would like?
    – Nathan W
    Jul 30 '13 at 21:38
  • Since the pipes obviously weren't digitized in downstream directions is there any attribute in the data which could tell QGIS where upstream and where downstream is?
    – underdark
    Jul 31 '13 at 19:35
  • Yes. Each pipe has an upstream and a downstream node.
    – Gpr
    Aug 1 '13 at 19:38

If your vectors are not necessarily in the right direction and if you have a point shapefile with elevations and correct topology, I would suggest the following:

  • Create a 'WKT' field in your point data with the WKT geometry of your point, using the field calculator: geom_to_wkt( $geometry) ;
  • For your pipe layer, choose expression-based rotation for your arrow marker:

Expression-based rotation

  • And use an expression such as this one:

     WHEN attribute(get_feature( 'Point_layer_name', 'WKT', geom_to_wkt(start_point( $geometry)) ),'Elevation_field') - attribute(get_feature( 'Point_layer_name', 'WKT', geom_to_wkt(end_point( $geometry)) ),'Elevation_field') < 0 THEN '270'
     ELSE '90'



There's a QGIS plugin Switch the Direction of a Polyline that does exactly what it says. Install it, and you get an additional button on your plugin toolbar that looks like a plug. With your pipe polyline layer in editing mode, select the features that you want to reverse the direction of, and click the button.

  • I tried it and it worked, but the file is too large and it is not possible to process it one by one. I downloaded a plugin to select all the upstream pipe and then do the switch to those that are not included and we will see. Thanks for your help!
    – Gpr
    Jul 31 '13 at 18:34
  • @Gpr Which plugin do you use to select all upstream pipes? I would like to use it. Thank you
    – user25976
    Apr 24 '14 at 22:29
  • @user25976 it is the "flow trace"
    – Gpr
    May 2 '14 at 13:31
  • we are developing a plugin that will check the network topology (gas pipes) and also will find the upstream and downstream along with automatic direction correction . let me know if you are interested. May 18 '16 at 5:29
  • @AbhijitGujar can you share this plugin please -we are doing similar with sewer lines.
    – GeorgeC
    Aug 31 '16 at 5:48

If you are using ArcMap and representing the sewer network using line features

go into the layers properties, change the line type to cartographic line symbol. From there you will want to select the line properties tab. In this window you should see a box named Line Decorations with 4 radial buttons. Select the choice that you need. Once you have done so you can edit the properties of the symbol (change the symbol from a triangle to a circle, change the number of positions, flip the symbol etc).

If you are using QGIS 1.8 go into the layer properties, and select the style tab. Click on the change button under the current depiction of the line In the new window select add symbol layer click on the drop down menu for symbol type and either select line decoration or marker line

line decoration will place an arrow at the end of the line segment in the direction of travel.

Line marker you will need to click on the change button next to marker in the symbol layer properties. Select an arrow, and if needed change the default angle of the arrow.

Sorry about not including the QGIS information earlier. I hope this information helps

  • thanks for the immediate answer. I did what you say on qgis (with the line marker) but the direction of the arrow doesn't go from upstream to downstream as i want. Each polyline has an upstream and a downstream edge. The arrow just seems to go from upper left corner to bottom right corner regardless of those edges. sorry if i confuse you...
    – Gpr
    Jul 30 '13 at 17:45
  • 1
    Remark: It's preferable to use "marker line" instead of "line decoration" which is deprecated and subject to removal. Source Jul 30 '13 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.