Identify connected overlapping polylines
Summary :: Usage :: Parameters :: Outputs :: Warnings :: Limitations :: Code sample
Summary
Checks for connected overlapping polylines, any found are logged in the error log table.
Usage
This tool checks for connected overlapping polylines. This is a line that is anchored\connected to the network at one end of the polyline, this is typically the TO-end connecting into a tributary junction and thus participates and influences network topology. Unlike a normal tributary junction one of the polylines fully overlaps the other and visually looks like a single continuous line. These errors are impossible to see if you are simply looking at the network. Such data can cause errors in subsequent processing of the network, such as duplicating sampling points or changing the stream order.
The topological test for an overlap can appear to identify junctions when there is no obvious overlap, in this case the error is likely a duplication in vertices at one end of one of the polylines. You can explore a polylines vertices and edit as needed as described here.
Experience has shown these overlaps often occur alongside other errors. A good example is the poorly constructed junction shown below. The small highlighted line 161071 is overlapped by 161069, but simply correcting this issue does not resolve the fact that 161173 is illogically crossing 161072. Be prepared to make multiple corrects at such locations.
Any selection on the input layer is cleared and then the tool checks all polylines in the river network. Any found to be connected and overlapping have their polyline ID written to an error log table called tblConnectedOverlap. 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 |
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 tblConnectedOverlap, if any overlapping geometries 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.
Warnings
The test for overlap is done by extracting the from- and to- ends of the polyline and asking if these points fall within a line. This will identify 3 possible errors: a genuine overlap of lines, a from-node intersecting a polyline which should really have been a network node (a good example is the upstream end of one side of a loop touching the other branch) and stacked vertices within a single polyline where polylines connect at a node. As all 3 types of error are seen as "points within a polyline" it's not possible to distinguish them by type until you have reviewed the error in the wider context of the network. Simply put, if the error does not seem to be an obvious line over line overlap then it will be a node touching another line or stacked vertices.
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
All polylines in the river network are tested, if a selection existed this is cleared prior to processing.
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
res = arcpy.scrQCConOver_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")
else:
print("No error table created!")
except arcpy.ExecuteError:
print("FAILED to quality control network")