ArcObjects Library Reference (NetworkAnalysis)  

ITraceFlowSolverGEN Interface

Provides access to members that perform traces on a network.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

When To Use

Use the ITraceFlowSolverGEN interface when you want to implement your own custom solver. This interface provides methods for common network tracing tasks such as find common ancestors and trace upstream.

Members

Description
Method FindAccumulation Finds the total cost of all reachable network elements based on the specified flow method.
Method FindCircuits Finds all reachable network elements that are parts of closed circuits in the network.
Method FindCommonAncestors Finds all reachable network elements that are upstream from all the specified origins.
Method FindFlowElements Finds all reachable network elements based on the specified flow method.
Method FindFlowEndElements Finds all reachable network end elements based on the specified flow method.
Method FindFlowUnreachedElements Finds all unreachable network elements based on the flow method.
Method FindPath Finds a path between the specified origins in the network.
Method FindSource Finds a path upstream to a source or downstream to a sink, depending on the specified flow method.
Method PutEdgeOrigins Sets the starting edges for this trace solver.
Method PutJunctionOrigins Sets the starting junctions for this trace solver.
Write-only property TraceIndeterminateFlow Indicates if directional traces include edges with indeterminate or uninitialized flow direction.

CoClasses that implement ITraceFlowSolverGEN

CoClasses and Classes Description
TraceFlowSolver A collection of basic trace flow solvers used to analyze networks.
[C#]
The following code shows you how to set up the TraceFlowSolver.  It assumes that myNetwork holds a reference to your network.
  // Establish the trace flow solver
  ITraceFlowSolverGEN traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
  INetSolver netSolver = traceFlowSolver as INetSolver;
  netSolver.SourceNetwork = myNetwork;
In order to do any type of trace analysis through the TraceFlowSolver you need to add flags to the solver. Whether you are adding one flag or multiple flags the solver requires an array of these flags. Junction flags and edge flags are added as seperate arrays.
For example, let's say your are doing a trace from one junction flag. The first step is to create a junction flag based on a feature in your network. Each feature in your network contains the following information needed to create a flag: the UserClassID, UserID, and UserSubID.
The UserClassID, UserID, and UserSubID are taken from the feature in the geometric network which you want to create a flag on. For information on getting these attributes from a feature see the Feature object help.
You can create a junction flag by using the following code:
  INetFlag junctionFlag = new JunctionFlagClass() as INetFlag; 
  junctionFlag.UserClassID = userClassID;
  junctionFlag.UserID = userID;
  junctionFlag.UserSubID = userSubID;
For more information on creating flags see the help for INetFlag.
Once you have created the flag you need to create an array of junction flags to add to the solver:
  IJunctionFlag[] junctionFlags = new IJunctionFlag[1];
  //Add the flag to the array
  junctionFlags[0] = junctionFlag as IJunctionFlag;
Now you can add the array to the TraceFlowSolver object.
  traceFlowSolver.PutJunctionOrigins(junctionFlags);
If you are planning to use a trace solver that will be considering flow direction, you need to set the TraceIndeterminateFlow property.  See the help for TraceIndeterminateFlow for more information on this property.
  traceFlowSolver.TraceIndeterminateFlow = true;
You can now call one of the tracing methods on the ITraceFlowSolverGEN interface.
[C++]
[Visual Basic .NET]
The following code shows you how to set up the TraceFlowSolver.  It assumes that myNetwork holds a reference to your network.
  ' Establish the trace flow solver
  Dim traceFlowSolver As ITraceFlowSolverGEN = New TraceFlowSolver
  Dim netSolver As INetSolver = CType(traceFlowSolver, INetSolver)
  netSolver.SourceNetwork = myNetwork
In order to do any type of trace analysis through the TraceFlowSolver you need to add flags to the solver. Whether you are adding one flag or multiple flags the solver requires an array of these flags. Junction flags and edge flags are added as seperate arrays.
For example, let's say your are doing a trace from one junction flag. The first step is to create a junction flag based on a feature in your network. Each feature in your network contains the following information needed to create a flag: the UserClassID, UserID, and UserSubID.
The UserClassID, UserID, and UserSubID are taken from the feature in the geometric network which you want to create a flag on. For information on getting these attributes from a feature see the Feature object help.
You can create a junction flag by using the following code:
  Dim junctionFlag As INetFlag = New JunctionFlag 
  junctionFlag.UserClassID = userClassID 
  junctionFlag.UserID = userID 
  junctionFlag.UserSubID = userSubID
For more information on creating flags see the help for INetFlag.
Once you have created the flag you need to create an array of junction flags to add to the solver:
  Dim junctionFlags(0) As IJunctionFlag
  'Add the flag to the array
  junctionFlags(0) = CType(junctionFlag, IJunctionFlag)
Now you can add the array to the TraceFlowSolver object.
  traceFlowSolver.PutJunctionOrigins(junctionFlags)
If you are planning to use a trace solver that will be considering flow direction, you need to set the TraceIndeterminateFlow property.  See the help for TraceIndeterminateFlow for more information on this property.
  traceFlowSolver.TraceIndeterminateFlow = True
You can now call one of the tracing methods on the ITraceFlowSolverGEN interface.

.NET Samples

Custom upstream trace task (Code Files: CustomUpstreamTraceTaskVBNet) |

.NET Related Topics

NetworkAnalysis |