Skip to main content

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

DirectionTypeParameter NameData TypeDialog Reference
InputRequiredInput Start PointsFeature SetInput 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.
InputOptionalInput Barriers (Optional)Feature SetInput 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.
InputRequiredInput Trace LayerFeature LayerFeature 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].
InputRequiredTrace DirectionString"Upstream" or "Downstream"Both would trace in Both upstream and downstream direction.
InputOptionalSearch DistanceLinear UnitDistance 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.
InputOptionalTrace Propagation CountLongNumber of downstream/upstream features at each feature used to propagate the trace:
  • 0 - all encountered downstream/upstream features will be used to propagate the trace.
  • 1 - only 1 feature will be used to propagate the trace. If trace feature class has fields HydroID and NextDownID, these will be used for tracing, otherwise from-node and to-node attributes will be used.
  • 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 elements, typically, [HYDROID, NextDownID] or [From_Node, To_Node]. will be used to propagate the trace.
  • InputOptionalTrace on Select SetBooleanControls whether to limit the trace to currently selected trace features:
  • True (checked) - tracing will be performed using only the selected set of features in the trace layer.
  • False (unchecked) - tracing will be performed using all features in the trace layer.
  • InputOptionalSnap Input PointsBoolean
    InputRequiredHydro Junction LayerFeature LayerHydro junctions related to the trace layer. Must have field NetID populated with the HydroID of the trace layer feature hydro junction is related to.
    InputOptionalRelated Layer (Optional)Feature LayerMust 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"

    )