Summary :: Usage :: Parameters :: Outputs :: Warnings :: Limitations :: Code sample


Checks for sources within the network, any found are logged in the error log table.


A source node is typically the terminal node of a network.  In relation to a river you can think of a source node as the point at which a stream appears on the surface, forming what some practitioners might refer to as a head water stream.

This tool checks for sources within the network. Careless digitising, topographic features and unnatural drainage patterns can all generate sources within a network. This tool identifies the nodes that are acting as sources but not at the end of a network. The logic used to identify a source within the network is:

  1. Identify all nodes which have no polylines flowing INTO them.
  2. Having located all nodes identified by rule 1 select those which have a valency of 2 or more. A normal source would have a single polyline flowing AWAY from it (this is a valency of 1).

The above logic will also identify the unusual situation of a source acting as a bifurcation. Here the source has a valency of 2, but both downstream polylines feed into the same catchment. 

A source with valency of 2

If you come across a single source node which is reporting a valency of 2 yet visually there appears to be a single channel flowing away from the node, then you probably have a polyline that is double digitised where the second polyline is an exact copy.

Be aware that:

Grid like drainage patterns will generate sources within a network.

Poor digitising (or automated vectorisation) can create polylines that flow towards each other.

Saddles are low points on ridges.  They are usually flat, wetland regions where streams form and start to flow down hill.  It is quite possible to have streams that flow in opposite directions.  Sometimes networks connect catchments at these points and whilst the polylines do flow in opposite directions your actual tracing algorithm may use this as a genuine network link to traverse along which would ultimately generate incorrect data (as they act as a short-cut across sub-catchments).


Poor vectorization

Short-cut saddle

Any found to sources within the network have their ID written to an error log table called tblSaddles. If the table already exists then a new table name is created with a simple numeric suffix.

The tool optionally adds the error log table to the map (default) and if selected builds a standard relate between river network layer and error log table. You can use the relate to select and jump to the polyline to streamline your editing experience.




Data type

River Network

The river network. For best results the network should be within a File GeoDatabase

Feature Layer

Add Error Log Table to Map

If this is ticked (default) the error log table will be added to the map for your convenience if any errors were found.


Build a Relate for Error Log

If this tick box is checked then the error log table must be loaded into the map and RivEX builds a standard relate between the Error Log table and the river network layer. You can use the relate to help you jump to and review the error.



This tool creates a stand alone table named tblSaddles, if any sources internal to the network are encountered within the river network.  The table is created in the RivEX workspace folder and stored in the File GeoDatabase found in ..\RivEX_Workspace\ErrorLogs\fGDB_RivEXErrorLogs.gdb.  What you do depends on the type of error, is may be as simple as flipping the direction of the line or introducing a break in the network to detach connecting sub catchments.

Advice on the structure of the error log table and how it can be used is found within this section of the manual. Take note of the warning if you plan to construct a model using the error log output in subsequent processing.


Having identified these internal sources and corrected them, you will have changed the topology of the network.  You must re-run your network through the Extract Network Topology and write to Workspace tool to rebuild and correctly attribute the node and polyline fields in your river network.

With the release of ArcGIS Pro 3.2.1 a switch control appears on parameters that accept tables\feature classes, do not interact with it! More advice here.


Any selection on the input layer is cleared and then the tool checks all nodes in the river network.

Code sample

A minimum code example showing how to call this tool in a python script. This can be run in console or your preferred IDE. If you right click on the tool in the RivEX toolbox and select properties you can view parameter order.

import arcpy

# Import RivEX toolbox

    # Input river Feature Class
    fc = r"C:\Temp\ORN\ORN.gdb\ORN"

    # Run RivEX quality control tool
    res = arcpy.scrQCSaddles_RivEX(fc, False, False)

    # The rivers Feature Class, a derived output
    fcRivers = res.getOutput(0)
    # Get error table
    tblError = res.getOutput(1)

    # Check if error table exists
    if arcpy.Exists(tblError):
        # Count number of rows
        res = arcpy.GetCount_management(tblError)
        n = int(res.getOutput(0))
        if n > 0:
            print(str(n) + " error(s) were recorded")
        print("No error table created!")
except arcpy.ExecuteError:
    print("FAILED to quality control network")

Return to top of page