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


Checks individual polylines for stacked vertices, any found are logged in the error log table.


This tool checks for stacked vertices within a polyline. Stacked vertices are when one or more vertices have the same XY location within a single polyline.  Stacking can occur if the source of the river network did not enforce valid geometry when the polyline was created. Stacked vertices can cause topological issues with some of the tools in RivEX.

The example below highlights two vertices that are stacking. Note stacking does not always have to be sequential as in this example where vertex #8 is an erroneous spur. In this example to solve the spur and stacking it would be suggested that vertices 8 and 9 are deleted out.

Stacked vertices

Any selection on the input river network is cleared and the tool checks all polylines in the river network. Any found to have stacked vertices will have their polyline ID and stacked vertex position written to an error log table called tblStackedVertices. 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.

You can use the edit vertices tool to reduce the stack to a single vertex.




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 tblStackedVertices, if any stacked vertices are encountered within the river network.  For each polyline with stacking occurring it will record the polyline ID and the index position of the stacked vertices.  It is possible that a single polyline could have multiple locations along its length where stacking is occurring.  The table is created in the RivEX workspace folder and stored in the File GeoDatabase found in ..\RivEX_Workspace\ErrorLogs\fGDB_RivEXErrorLogs.gdb

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.


This tool can be used to find stacked vertices along the length of the polyline but be aware a polyline that is closing in on itself (its start and end are the same node) will also report as stacked vertices. This type of stacking will also be identified by the quality control tool Identify looping polyline.

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.


If the river network is Z-enabled, the Z location is not considered by this tool when it is testing for stacking.

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.scrQCStackedVertices_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