Create points where lake intersects river network
Summary :: Usage :: Parameters :: Outputs :: Warnings :: Limitations :: Code sample
Summary
Create points where lake boundaries intersect the river network. You can filter which type of points are identified.
Usage
Requirement for using this tool:
To use this tool you must have attributed the network with:
This tool generates a new dataset of points created from the intersection of the river network with the lake boundary. You can choose to extract all the points or a subset based upon point type. Such points could be the pour points for catchment delineation, or, used to link information back to the lake itself.
Ullswater, UK. All lake edge intersection points extracted and colour coded by type.
You can choose to process a subset of your lake data by selecting them and ticking on the Use only selected polygons. If no selection exists then all lakes are processed. The polygon layer must have a numeric (integer) ID field (which can't be the ObjectID) that uniquely identifies each polygon.
If a selection exists on the river network this is cleared.
The output is written to a File GeoDatabase called fGDB_Sites.gdb which is stored in the Outputs folder in the RivEX Workspace. You can control the name of the Feature Class but not its location. The output name must be a valid file geodatabase name.
You must choose which type of lake edge point you wish to extract, you can extract:
- Outlet - A single point which is the lake outlet or "pour point", this will be at the downstream end of the lake.
- Source input - A single point that is the input into the lake coming from the source of the river (the source ID), this will be at the upstream end of the lake.
- All - All points will be extracted.
RivEX resolves the scenario of tributaries weaving in and out of the lake polygon due to poor spatial alignment of the river centreline. It keeps the "last point" rejecting all other erroneous intersection locations. The last point is the point with the furthest distance from network mouth. In the image below the intersections marked with a black square are not created.
Another scenario dealt with that you should be aware of are lakes at the source of a river, they have no input, only an outlet as shown below.
Tick Add attribute index and RivEX will create an index for the LakeID field in the output Feature Class, this will improve any query/join performance using this field.
Parameters
Name |
Help |
Data type |
River Network |
The river network. For best results the network should be within a File GeoDatabase |
Feature Layer |
Lake layer |
The polygon layer used to intersect with the network. This would typically be a dataset representing lake polygons. this must be in the same coordinate system as the river network. |
Feature Layer |
Lake ID field |
A numeric field uniquely identifying the lake polygon. This field must contain unique numbers and cannot be the ObjectID field. |
Field |
Use only selected polygons |
Controls if selections are honoured or cleared.
|
Boolean |
Point type |
You can choose which lake edge points are written to the output Feature Class.
|
String |
Output feature class name |
The Feature class name, this must be a valid file geodatabase table name, so cannot have spaces, unusual characters or start with a number. You have no control over its location, it will be stored in the output folder in ..\RivEX_Workspace\Outputs\fGDB_Sites.gdb |
String |
Add an attribute index to output |
Indicates if RivEX will create an attribute index for the site ID field in the output table.
If you plan to join or relate data then it is STRONGLY recommended you create attribute indices for the outputs; an index can significantly speed up query operations. |
Boolean |
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
The output table can be given a name but you have no control over where it is stored, this would be in the file geodatabase in the output folder ..\RivEX_Workspace\Outputs\fGDB_Sites.gdb.
The output table contains the following fields:
Field |
Description |
LakeID |
The unique lake ID |
PointID |
The unique numeric ID given to the point |
Point_Type |
The type of lake edge point this can be:
|
SrcID |
The source ID as encoded into the river network that the edge lake point is on. |
Dist2Mth |
The distance to the network mouth for the lake edge point. |
Point_X |
The X coordinate of the point |
Point_Y |
The Y coordinate of the point |
If errors were generated then this tool can create a stand alone table named tblLakeErrors. The table is created in the RivEX workspace folder and stored in the File GeoDatabase found in ..\RivEX_Workspace\ErrorLogs\fGDB_RivEXErrorLogs.gdb. The error log will record lakes that did not intersect the network.
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
Lakes\ponds that do no intersect the network are excluded and reported in the error log table.
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 reject river networks that do not have linear units. Networks in latitude/longitude will be rejected.
- The lake layer must be in the same coordinate system as the river network.
- The lake layer cannot have a join, you either need to remove the join or make it permanent.
- The lake ID must hold a unique numeric (integer) ID for each polygon.
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
fcRivers = r"C:\Temp\ORN\ORN.gdb\ORN"
# Input lake Feature Class
fcLakes = r"C:\Temp\ORN\ORN.gdb\Lakes"
# Run RivEX tool
res = arcpy.scrLakeEdgePoints_RivEX(fcRivers, fcLakes, "WBID", False, "All", "LakeEdgePoints", True, False, False)
# Get lake edge points Feature Class
fcEdgePoints = res.getOutput(0)
# Get a count on number of points extracted
res = arcpy.GetCount_management(fcEdgePoints)
n = int(res.getOutput(0))
print("Number of lake edge points extracted = " + str(n))
except arcpy.ExecuteError:
print("FAILED to extract lake edge points")