This document is archived and information here might be outdated.  Recommended version.


INATraversalResultQuery Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalyst > ESRI.ArcGIS.NetworkAnalyst > Interfaces > IN > INATraversalResultQuery Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

INATraversalResultQuery Interface

Provides access to the results of an analysis.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Members

Name Description
Read-only property ElementIDFieldName The element ID field name.
Read-only property FeatureClass The feature class by element type.
Read-only property FromEdgeIDFieldName The from edge ID field name.
Read-only property FromJunctionIDFieldName The from junction ID field name.
Read-only property FromPositionFieldName The from position field name.
Method SearchConnected Returns a connected set of elements in the result.
Read-only property SourceIDFieldName The source ID field name.
Read-only property SourceOIDFieldName The source OID field name.
Read-only property ToEdgeIDFieldName The to edge ID field name.
Read-only property ToJunctionIDFieldName The to junction ID field name.
Read-only property ToPositionFieldName The to position field name.

CoClasses that implement INATraversalResultQuery

CoClasses and Classes Description
NATraversalResult Contains the result of a network analysis.

Remarks

INATraversalResultQuery has been superseded by INATraversalResultQuery2.

[C#]

This C# example shows how you can add a feature class returned by the FeatureClass property on INATraversalResultQuery to a map.


public void AddNATraversalResultToMap(ESRI.ArcGIS.NetworkAnalyst.INALayer naLayer, ESRI.ArcGIS.Carto.IMap map)


{


ESRI.ArcGIS.NetworkAnalyst.
INATraversalResultQuery traversalResultQuery=naLayer.Context.Result as ESRI.ArcGIS.NetworkAnalyst.INATraversalResultQuery;


ESRI.ArcGIS.NetworkAnalyst.
INATraversalResultEdit naTraversalResultEdit=traversalResultQuery as ESRI.ArcGIS.NetworkAnalyst.INATraversalResultEdit;





// Infer Geometry


naTraversalResultEdit.InferGeometry(
string.Empty, null, new ESRI.ArcGIS.Display.CancelTrackerClass());





// Get the Edges and add as a layer


ESRI.ArcGIS.Carto.
IFeatureLayer featureLayer=new ESRI.ArcGIS.Carto.FeatureLayerClass();


featureLayer.FeatureClass=traversalResultQuery.get_FeatureClass(ESRI.ArcGIS.Geodatabase.
esriNetworkElementType.esriNETEdge);


featureLayer.Name=featureLayer.FeatureClass.AliasName;


map.AddLayer(featureLayer);





// Get the Junctions and add as a layer


featureLayer=
new ESRI.ArcGIS.Carto.FeatureLayerClass();


featureLayer.FeatureClass=traversalResultQuery.get_FeatureClass(ESRI.ArcGIS.Geodatabase.
esriNetworkElementType.esriNETJunction);


featureLayer.Name=featureLayer.FeatureClass.AliasName;


map.AddLayer(featureLayer);


}

[Visual Basic .NET]

This VB.NET example shows how you can add a feature class returned by the FeatureClass property on INATraversalResultQuery to a map.

Public Sub AddNATraversalResultToMap(ByVal naLayer As INALayer, ByVal map As IMap)
    Dim traversalResultQuery As INATraversalResultQuery=naLayer.Context.Result
    Dim naTraversalResultEdit As INATraversalResultEdit=traversalResultQuery
    ' Infer Geometry
    naTraversalResultEdit.InferGeometry(String.Empty, Nothing, New CancelTracker())
    ' Get the Edges and add as a layer
    Dim featureLayer As IFeatureLayer=New FeatureLayer()
    featureLayer.FeatureClass=traversalResultQuery.FeatureClass(esriNetworkElementType.esriNETEdge)
    featureLayer.Name=featureLayer.FeatureClass.AliasName
    map.AddLayer(featureLayer)
    ' Get the Junctions and add as a layer
    featureLayer=New FeatureLayer()
    featureLayer.FeatureClass=traversalResultQuery.FeatureClass(esriNetworkElementType.esriNETJunction)
    featureLayer.Name=featureLayer.FeatureClass.AliasName
    map.AddLayer(featureLayer)
End Sub


 

.NET Samples

Add a traversal result to the map (Code Files: AddTraversalResultsToMap)