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

Summary


Checks for short polylines composed of only 2 vertices, any found are logged in the error log table. Note these may not be errors but genuinely small polylines forming part of your river network.

Usage


This tool checks for short polylines composed of only 2 vertices. Experience has shown that very small polylines, usually comprising of two vertices can sometimes be digitising errors.  Such errors tend to occur in river networks showing the grid like patterns of managed water ways. . The length to test is a default 1m but you can change this.


Below is an image where a two vertex polyline of less than 1m in length (green) has been identified by RivEX. 


Small 2 vertex polyline


This does not invalidate the topology of the network and could be left in.  In reality the polylines marked 1 and 2 would connect to each other at a single node as there is no Z-bend. You could delete the green polyline and snap the other polylines to one of the nodes.


If your input river network is in a coordinate system that is units of feet, then the length parameter which takes a metre value to be entered will be converted to feet.


Any found to be short and composed of only 2 vertices have their polyline ID written to an error log table called tblShort2vertices. 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. 


Parameters


Name

Help

Data type

River Network

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

Feature Layer

Length (m)

The maximum length a line can be, for it to be a candidate for checking. Any line longer than this value and also composed of just 2 vertices will be skipped. The default is 1m but you can change this. The value must be greater than zero.

Double

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.

Boolean

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.

Boolean

Outputs


This tool creates a stand alone table named tblShort2vertices, if any candidate lines 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


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.

WarningWarnings


Having identified these short features 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.

Limitations


This tool will not process data that has a latitude/longitude coordinate system (e.g. WGS84).  You need to project your river network into a coordinate system that uses metres or feet.


Any selection on the input is cleared so the tool can check all polylines in the river network.


These small lines may not be errors but genuinely small polylines forming part of your river network and there would be no harm in leaving them in.


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
arcpy.ImportToolbox(r"C:\RivEX_ArcPro\RivEX.atbx")

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

    # Run RivEX quality control tool, defaulting to 1m search length
    res = arcpy.scrQCSmall2PtPolylines_RivEX(fc, 1, 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")
    else:
        print("No error table created!")
except arcpy.ExecuteError:
    print("FAILED to quality control network")


Return to top of page