Create a node layer
Summary :: Usage :: Parameters :: Outputs :: Warnings :: Limitations :: Code sample
Summary
This tool can extract out specific nodes by their type and store them in the RivEX output folder.
Usage
This tool can extract out specific nodes by their type and store them in the RivEX output folder. Any selection on the input river network is cleared before extraction runs. You can extract 4 types of layers:
Layer |
Description |
Mouth |
Only mouth nodes are extracted |
Source |
Only source nodes are extracted |
Pseudo |
Only Pseudo nodes are extracted |
All Nodes |
All nodes are extracted along with their type and valency |
An example of the node dataset labelled by NodeID.
If tool is run within ArcPro then output is automatically added to the map.
Parameters
Name |
Help |
Data type |
River Network |
The river network. For best results the network should be within a File GeoDatabase |
Feature Layer |
Node type |
The type of node you wish to extract from the network
|
String |
Outputs
The All nodes option will also include a node valency field and a text field identifying type of node. Valency is the number of lines connecting to the node, the direction of line (i.e. flowing towards or away from the node) is irrelevant. Nodes are given a type code, these are listed in the table below:
Code |
Meaning |
Definition |
S |
Source |
A node which has no polylines flowing into it. |
M |
Mouth |
A node which has no polylines flowing out of it. |
P |
Pseudo-node |
A node which has 1 polyline flowing in and 1 polyline flowing out. |
C |
Confluence |
A node which has 2 or more polylines flowing in and 1 polyline flowing out. |
D |
Divergence |
A node that has 1 polyline flowing in but has 2 or more polylines flow out. |
B |
Both confluence & divergence |
A node that has 2 or more polylines flowing into it and 2 or more polylines flowing out. |
A screen shot of the All nodes layer, note the additional two fields valency and node type.
The output Feature Class names are: fcMouthsNodes, fcSourceNodes, fcPseudoNodes and fcNodes and are stored in the File GeoDatabase found in ..\RivEX_Workspace\Outputs\fGDB_Nodes.gdb
Warnings
These datasets are extracts from the river network and not a live link to the network. If you have subsequently edited the network then you will have likely modified the network topology and the number of nodes (and possibly position) will have changed. In this case you will want to repeat the extraction of the node layers.
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 processed, 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 tool, extracting out only source nodes
res = arcpy.scrNodes_RivEX(fc, "Source nodes")
# Get source node Feature Class
fcSources = res.getOutput(0)
# Get a count on number of nodes extracted
res = arcpy.GetCount_management(fcSources)
n = int(res.getOutput(0))
print("Number of sources extracted = " + str(n))
except arcpy.ExecuteError:
print("FAILED to extract node layer")