Trace (Trace Network) – ArcGIS Pro 3.5
Essence of the Trace Tool in ArcGIS Pro 3.5
The Trace geoprocessing tool is designed to return those features in a Trace Network that are reachable—either by pure connectivity or by more restrictive “traversability” rules—from one or more user-specified starting points. Traversability augments connectivity by also honoring flow direction, attribute-based barriers, function-based cut-offs, and any named trace configuration that may already exist in the geodatabase. Results can be delivered as conventional feature selections, aggregated geometries, network layers, or JSON-encoded graphs/elements.
Conceptual Foundations
A Trace Network models real-world linear systems such as hydrography, trails, or gas pipelines. Tracing analyses rely on an enabled and validated network topology; "dirty areas" (locations where edits have not yet been validated) jeopardize accuracy. When working in an Enterprise Geodatabase, the input Trace Network must be consumed through a feature service rather than via a direct database connection.
Paths discovered during a trace fall into two conceptual categories:
- Connectivity Paths – reachability that relies solely on topological adjacency.
- Traversability Paths – connectivity paths that also satisfy flow and attribute constraints.
Partial-feature returns are possible when barriers or starting points are placed midspan on edges; to expose these fragments you must set Result Types → Aggregated Geometry.
Tool Invocation (GUI and Python Parity)
Internally the same parameter schema drives both the ArcGIS Pro dialog and the arcpy.tn.Trace() function. All parameter names appear in the transcript; only the casing and enumeration syntax differ slightly between the GUI and the Python API.
Mandatory Inputs
- Input Trace Network – The network layer or dataset to be traced.
- Trace Type – One of four modes:
• Connected; • Upstream; • Downstream; • Shortest Path. Upstream/Downstream require flow to be established; Shortest Path needs a cost attribute (e.g., ). - Starting Points – A feature layer, table, or the auto-generated
TN_Temp_Starting_PointsFC created from the Trace Locations pane.
Core Optional Inputs that Influence Traversability
• Barriers – Feature layer or table (default TN_Temp_Barriers) that halts traversal.
• Path Direction – Honored only for Shortest Path traces (NO_DIRECTION, UPSTREAM_PATH, DOWNSTREAM_PATH).
• Shortest Path Network Attribute Name – Numeric attribute (distance or cost) used by Shortest Path.
• Include Barrier Features – Boolean toggle to return barrier features in the result set.
• Validate Consistency – When checked, the tool aborts upon encountering dirty areas; otherwise it proceeds with a warning.
• Ignore Barriers At Starting Points – Lets you begin "inside" a barrier if desired.
• Allow Indeterminate Flow – For Upstream/Downstream traces, decides whether to step through features whose flow is not yet defined.
Attribute-Driven Controls
Condition Barriers
Stop the trace once a feature meets an attribute comparison. Syntax: [Name, Operator, Type, Value, Combine Using]. Operators include Is equal to, Is greater than, etc. Combine Using supports logical or . Types are either Specific Value or Network Attribute.
Function Barriers
Accumulate a running statistic (MIN, MAX, ADD, AVERAGE, COUNT, SUBTRACT) over traversed features and stop once an operator/value threshold is met. Local vs Global evaluation is controlled by the Use Local Values flag.
Example: "Add Shape Length Is Greater Than Or Equal To " halts a trace once total path length reaches .
Traversability Scope
Determines whether the above barriers apply to junctions, edges, or both (default).
Functions (Post-Trace Analytics)
Optional statistics calculated on the result set, not during traversal. Same function/operator/value schema as Function Barriers but applied after the trace stops; can be further filtered by attribute name/operator/type/value.
Output Conditions
Filter the final result set by attribute. Syntax mirrors Condition Barriers but acts after tracing is complete. Handy for "return only taps" styles of queries.
Result Management
Result Types
SELECTION (default), AGGREGATED_GEOMETRY, NETWORK_LAYERS, CONNECTIVITY (JSON graph), ELEMENTS (JSON features).
• For Aggregated Geometry you must supply (or accept defaults for) Aggregated Points, Aggregated Lines, Clear All Previous Trace Results, and optionally Trace Name.
• For Network Layers you can name the Output Group Layer that will hold the selected features.
• For JSON outputs you designate Output JSON path.
Selection Type Logic
How the new selection interacts with any pre-existing selection: NEWSELECTION, ADDTOSELECTION, REMOVEFROMSELECTION, SUBSETSELECTION, or SWITCH_SELECTION.
Named Trace Configurations (Version 2+)
If your Trace Network schema supports version 2 configurations, you can set Use Trace Configuration → Checked and supply Trace Configuration Name. In that scenario, all dialog parameters except Starting Points and Barriers are populated from the saved configuration.
Python Usage Pattern
import arcpy
# Required: path to network (feature class or layer)
net = r"C:\MyProject\NHD.gdb\Hydro\HydroNetwork"
# Optional: starting points / barriers produced via UI or scripted
starts = r"C:\Projects\Default.gdb\TN_Temp_Starting_Points"
stops = r"C:\Projects\Default.gdb\TN_Temp_Barriers"
# Example – Downstream trace that stops when accumulated length = 500 m.
trace_res = arcpy.tn.Trace(
net,
"DOWNSTREAM",
starts,
stops,
"NO_DIRECTION", # path_direction (ignored here)
"", # shortest_path_attribute
"INCLUDE_BARRIERS",
"VALIDATE_CONSISTENCY",
"DO_NOT_IGNORE_BARRIERS_AT_STARTING_POINTS",
"IGNORE_INDETERMINATE_FLOW",
None, # condition_barriers
"ADD 'Shape length' IS_EQUAL_TO 500 true", # function_barriers
"BOTH_JUNCTIONS_AND_EDGES", # traversability_scope
None, # functions
None, # output_conditions
"NETWORK_LAYERS", # result_types
"NEW_SELECTION",
"CLEAR_ALL_PREVIOUS_TRACE_RESULTS",
"", "", "", # trace_name / aggregated outputs omitted
"MyTraceResult" # out_network_layer
)
Date Handling in Attributes
Whenever a network attribute is mapped to a Date field (for barriers, functions, or output conditions), format literal values as yyyy-mm-dd hh:mm:ss — e.g., 2020-10-12 18:45:31.
Environment and Licensing Notes
The Trace tool ignores all GP environment settings; behavior is completely driven by explicit parameters. Licensing tier requirements: • Basic ✗ • Standard ✓ • Advanced ✓.
Practical Tips & Implications
• Always validate the topology within the geographical area you intend to trace. Failure to do so can trigger errors (if Validate Consistency is on) or silently degrade accuracy.
• When you need only the portion of an edge up to a barrier or starting point, choose Aggregated Geometry; otherwise the whole edge is returned.
• Shortest-Path traces ignore flow direction by design. If you want a cost-aware path that still respects flow, you must pre-compute a directed cost attribute and run Upstream/Downstream with that attribute embedded in Function Barriers.
• JSON result modes are excellent for integration with non-ArcGIS systems or for graph analytics; they write either a connectivity graph or feature-element array directly to disk.
Derived Output
Upon successful execution the tool returns the updated Trace Network layer as an in-memory object so it can be chained to subsequent geoprocessing steps.
Related Learning Resources
• “Overview of the Trace Network toolbox” in ArcGIS Pro help.
• “Find a geoprocessing tool” pane for quick keyword search.