FindCommonAncestors

Title  Find Common Ancestor

Description

Iterate through the starting points to trace the utility network and find the common features.

Usage

          
The starting points are optionally grouped so set of starting points is used in each trace.
The starting points layer uses a field to determine if a row is a starting point and/or barrier. A feature as a starting point and filter barrier is useful in a connected trace to determine all the items between the starting points.

The starting points table requires the following fields:
  • FEATUREGLOBALID: GUID or GLOBALID: GlobalID
  • TERMINALID: Short
  • PERCENTALONG: Double

License

Standard

Toolset

Utility Network

Syntax

FindCommonAncestors (in_utility_network, trace_locations, trace_config, {output_folder}, {expression}, {key_field}, {default_terminal_id}, {find_first})

Parameter Explanation Data Type
in_utility_network Dialog Reference

The utility network that will be used to trace.

GPUtilityNetworkLayer
trace_locations Dialog Reference

The table from which to load starting points for trace.

GPTableView
trace_config Dialog Reference

The utility network trace configuration used to define the trace parameters or a field with trace configurations.

GPString
output_folder (Optional) Dialog Reference

The location of the output items.

DEFolder
expression (Optional) Dialog Reference

The simple calculation expression used to limit the starting points used in a trace.

GPSQLExpression
key_field (Optional) Dialog Reference

Field used to group starting points and barriers. When specified, records with the same value will be used for a single trace. By default, a trace is run for every starting point.

Field
default_terminal_id (Optional) Dialog Reference

The default terminal ID for starting locations when the terminal ID field is not present or null and the percent along value is less than 0.

GPLong
find_first (Optional) Dialog Reference

Option to return only the first or edge features.

GPBoolean

Code Samples

FindCommonAncestors example 1 (Python window)

Iterate through the starting points to trace the utility network to find the common features.

import arcpy

arcpy.udms.FindCommonAncestors(
    "D:/data/UtilityNetwork.gdb/UtilityNetwork/Network",
    "D:/data/TraceLocations.gdb/Starting_Points",
    None,
    None,
    "Trace Config:: Upstream Items",
    None,
    "D:/data/",
    True,
)

FindCommonAncestors example 2 (stand-alone script)

Iterate through the starting points to trace the utility network to find the common features.

import arcpy

utility_network = "D:/data/UtilityNetwork.gdb/UtilityNetwork/Network"
trace_locations = "D:/data/TraceLocations.gdb/Starting_Points"
output_folder = "D:/data"
key_field = "SectionName"
trace_config = "Trace Config:: Upstream Items"

arcpy.udms.FindCommonAncestors(
    utility_network=utility_network,
    trace_locations=trace_locations,
    expression=None,
    key_field=key_field,
    trace_config=trace_config,
    default_terminal_id=None,
    output_folder=output_folder,
    find_first=True,
)