Advanced Trace by AH Attribute
Description
Traces upstream or downstream using Arc Hydro Trace by AH Attribute base functionality. In addition, it selects resulting hydro junction features and if provided, additional related features to hydro junctions. Review help for Trace by AH Attribute for description of base Arc Hydro attribute tracing functionality.
Hydro junction feature class must have HydroID and NetID fields populated. NetID value for a junction is HydroID of the underlying tracing layer feature that the junction resides on. It is used for junction selection once trace returns selected trace features (attribute selection). If optional Relate layer is provided, it must have attribute JunctionID populated that contains the HydroID of the junction the feature is related to. Related layer can be of any feature type (point, line, or polygon).
{
"displayFieldName": "",
"features": [
{
"attributes": {
"OBJECTID": 1
},
"geometry": {
"x": -13539581,
"y": 4462328
}
}
],
"fieldAliases": {
"OBJECTID": "OBJECTID"
},
"fields": [
{
"alias": "OBJECTID",
"name": "OBJECTID",
"type": "esriFieldTypeOID"
}
],
"geometryType": "esriGeometryPoint",
"spatialReference": {
"latestWkid": 3857,
"wkid": 102100
}
}
Usage
Parameters
Direction | Type | Parameter Name | Data Type | Dialog Reference |
---|---|---|---|---|
Input | Required | Input Start Points | Feature Set | Input points to be used as starting points for the trace. They are used to select the trace features that will originate the trace. One or many can be defined. They should be placed on or near the trace feature to make sure correct selection is made. The point needs to be within "Search Distance" from a trace feature to be used in tracing. Points can be defined either interactively or as a feature class. If defined interactively, they will be stored in temporary feature class "ts_start_points" in scratch geodatabase. Interactive points are transient in nature. Next run of the tool will overwrite them. |
Input | Optional | Input Barriers (Optional) | Feature Set | Input points to be used as barriers for the trace. They are used to select the trace features that will prevent propagation of the trace. One or many can be defined. They should be placed on or near the trace feature to make sure correct selection is made. The point needs to be within "Search Distance" from a trace feature to be barrier for tracing. Points can be defined either interactively or as a feature class. If defined interactively, they will be stored in temporary feature class "ts_barriers" in scratch geodatabase. Interactive points are transient in nature. Next run of the tool will overwrite them. |
Input | Required | Input Trace Layer | Feature Layer | Feature class to be used for tracing. Any type of feature class can be used to trace through as long as it has appropriate fields identifying downstream features.typically, [HYDROID, NextDownID] or [From_Node, To_Node]. |
Input | Required | Trace Direction | String | "Upstream" or "Downstream"Both would trace in Both upstream and downstream direction. |
Input | Optional | Search Distance | Linear Unit | Distance used to perform spatial selection of trace features used as start and barrier features based on input points. To precisely control the trace features to use, best practice is to snap the point onto the trace feature and set the "Search Distance" to 0. Larger search distance can be used to make multiple feature selections with a single point. |
Input | Optional | Trace Propagation Count | Long | Number of downstream/upstream features at each feature used to propagate the trace: |
Input | Optional | Trace on Select Set | Boolean | Controls whether to limit the trace to currently selected trace features: |
Input | Optional | Snap Input Points | Boolean | |
Input | Required | Hydro Junction Layer | Feature Layer | Hydro junctions related to the trace layer. Must have field NetID populated with the HydroID of the trace layer feature hydro junction is related to. |
Input | Optional | Related Layer (Optional) | Feature Layer | Must have field JunctionID populated with the HydroID of the hydro junction the feature is related to. It can be of any feature type (point, line, or polygon). |
Code Sample
arcpy.ImportToolbox(r"C:\AppData\AHNetworkTracing\AHNetwork20240125\srcPy\toolboxes\AHNetwork.atbx")
arcpy.AHNetwork.tracetolocatevip(
Input_Start_Points="Trace_by_AH_Attributes_to_Locate_VIP_Input_Start_Points_Points",
Input_Barriers="Trace_by_AH_Attributes_to_Locate_VIP_Input_Barriers_Points",
Input_Trace_Layer="HydroEdgeCopyMerged",
Trace_Direction="Upstream",
Search_Distance="50 Meters",
Trace_Propagation_Count=0,
Exclude_Start_Elements=False,
Trace_on_selectset=False,
PointLayerByAttribute="HJ_POD_Nov012021_HUC4_AllAtt",
Point_Layer_By_Location="POD_Nov012021_HUC4_CatAtt"
)