INetworkQuery Interface

Provides access to members that query the elements of the network dataset.

Members

Name Description
Method ClearIDCache Empties the contents of the index used for finding network elements by source.
Read-only property ComplexTurnCount Number of turn elements in the network dataset having more than two edge elements participating.
Method ConvertLocalTimeToUTCTime Converts local time for the given time zone to UTC time.
Method ConvertUTCTimeToLocalTime Converts UTC time to local time for the given time zone.
Method CreateForwardStar Creates a NetworkForwardStar object for traversing the network dataset.
Method CreateForwardStarAdjacencies Creates a NetworkForwardStarAdjacencies container object for forward star queries.
Method CreateNetworkElement Creates an uninitialized network element of the specified type for use in network dataset queries.
Read-only property EdgesByPosition Edge elements in the network dataset with a from and to position that includes the given position for the given source object.
Read-only property EdgesBySegment Edge elements in the network dataset with a from and to position included in the given range for the given source object.
Read-only property ElementCount Number of network elements of the given type in the network dataset.
Read-only property Elements Enumeration of all elements in the network dataset of the given type.
Read-only property ElementsByOID Elements in the network dataset corresponding to the given source object.
Read-only property ElementsByOIDs Elements in the network dataset corresponding to the given source objects.
Read-only property ElementsForSource Enumeration of all elements in the network dataset corresponding to the given source.
Read-only property MaxEID Highest element ID in the network dataset for the given element type.
Read-only property MaxValence Maximum number of edge elements connected to any single junction element.
Method PopulateIDCache Initializes the index used for quickly finding network elements for the given source ID.
Method QueryEdge Performs a network edge element query by element ID and edge direction and populates the given edge element object.
Method QueryJunction Performs a network junction element query by element ID and populates the given junction element object.
Method QueryTurn Performs a network turn element query by element ID and populates the given turn element object.
Method RefreshDynamicTrafficData Refreshes the current dynamic traffic data referenced by the network dataset based on the specified time and usage.
Read-only property TimeZoneID The time zone ID for the given network element.

INetworkQuery.ClearIDCache Method

Empties the contents of the index used for finding network elements by source.

Public Sub ClearIDCache ( _
)
public void ClearIDCache (
);

INetworkQuery.ComplexTurnCount Property

Number of turn elements in the network dataset having more than two edge elements participating.

Public ReadOnly Property ComplexTurnCount As Integer
public int ComplexTurnCount {get;}

Remarks

The ComplexTurnCount is the number of turn elements that traverse three or more edge elements in the network.

INetworkQuery.ConvertLocalTimeToUTCTime Method

Converts local time for the given time zone to UTC time.

Public Function ConvertLocalTimeToUTCTime ( _
    ByVal localTimeZoneID As Integer, _
    ByVal localTime As DateTime _
) As DateTime
public DateTime ConvertLocalTimeToUTCTime (
    int localTimeZoneID,
    DateTime localTime
);

INetworkQuery.ConvertUTCTimeToLocalTime Method

Converts UTC time to local time for the given time zone.

Public Function ConvertUTCTimeToLocalTime ( _
    ByVal localTimeZoneID As Integer, _
    ByVal utcTime As DateTime _
) As DateTime
public DateTime ConvertUTCTimeToLocalTime (
    int localTimeZoneID,
    DateTime utcTime
);

INetworkQuery.CreateForwardStar Method

Creates a NetworkForwardStar object for traversing the network dataset.

Public Function CreateForwardStar ( _
) As INetworkForwardStar
public INetworkForwardStar CreateForwardStar (
);

Remarks

CreateForwardStar can only be called when a Network license is checked out.

Before using the INetworkForwardStar object, you must specify its traversal parameters in the INetworkForwardStarSetup interface.

INetworkQuery.CreateForwardStarAdjacencies Method

Creates a NetworkForwardStarAdjacencies container object for forward star queries.

Public Function CreateForwardStarAdjacencies ( _
) As INetworkForwardStarAdjacencies
public INetworkForwardStarAdjacencies CreateForwardStarAdjacencies (
);

Remarks

The INetworkForwardStarAdjacencies object is populated by passing it as a parameter to the INetworkForwardStar::QueryAdjacencies method. The INetworkForwardStarAdjacencies object should be reused in subsequent calls to INetworkForwardStar::QueryAdjacencies

INetworkQuery.CreateNetworkElement Method

Creates an uninitialized network element of the specified type for use in network dataset queries.

Public Function CreateNetworkElement ( _
    ByVal ElementType As esriNetworkElementType _
) As INetworkElement
public INetworkElement CreateNetworkElement (
    esriNetworkElementType ElementType
);

Remarks

The CreateNetworkElement method creates an empty network element object of the specified element type. This object is passed to the Query methods on the INetworkQuery, INetworkForwardStarAdjacencies, INetworkJunction, INetworkEdge, and INetworkTurn interfaces. When calling these Query methods, the empty network element object is populated with the appropriate information from the queried element.

INetworkQuery.EdgesByPosition Property

Edge elements in the network dataset with a from and to position that includes the given position for the given source object.

Public Function get_EdgesByPosition ( _
    ByVal SourceID As Integer, _
    ByVal OID As Integer, _
    ByVal Position As Double, _
    ByVal includeRelatedSDCHyperEdges As Boolean _
) As IEnumNetworkElement
public IEnumNetworkElement get_EdgesByPosition (
    int SourceID,
    int OID,
    double Position,
    bool includeRelatedSDCHyperEdges
);

Remarks

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

The Position parameter refers to the positional value along the source feature from which this edge element was created. The Position parameter value ranges from 0.0 to 1.0, where 0.0 is at the from-end of the feature and 1.0 is at the to-end of the feature.

The includeRelatedSdcHyperEdges parameter determines whether the associated hyperedge elements are also returned in the enumeration. If set to True, the network element associated with the given feature and position, along with all of the covering hyperedge elements will be returned. If set to False, only the network element associated with the given feature and position will be returned. This parameter only has an effect for SDC network datasets. For other types of network datasets, this parameter has no effect as all elements associated with the given feature and position (whether hyperedge or not) will be returned.

The edge element(s) returned in the enumeration will be oriented in the esriNEDAlongDigitized Direction. To get the edge element in the esriNEDAgainstDigitized Direction, call INetworkEdge::QueryEdgeInOtherDirection on the returned edge.

The IEnumNetworkElement enumeration object returned by the EdgesByPosition property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

INetworkQuery.EdgesBySegment Property

Edge elements in the network dataset with a from and to position included in the given range for the given source object.

Public Function get_EdgesBySegment ( _
    ByVal SourceID As Integer, _
    ByVal OID As Integer, _
    ByVal fromPosition As Double, _
    ByVal toPosition As Double _
) As IEnumNetworkElement
public IEnumNetworkElement get_EdgesBySegment (
    int SourceID,
    int OID,
    double fromPosition,
    double toPosition
);

Remarks

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

The fromPosition and toPosition parameters refer to the positional values along the source feature from which this edge element was created. The position values range from 0.0 to 1.0, where 0.0 is at the from-end of the feature and 1.0 is at the to-end of the feature.

The IEnumNetworkElement enumeration object returned by the EdgesBySegment property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

If the fromPosition parameter is greater than the toPosition parameter, the edge element(s) returned in the enumeration will be oriented in the esriNEDAgainstDigitized Direction.

INetworkQuery.ElementCount Property

Number of network elements of the given type in the network dataset.

Public Function get_ElementCount ( _
    ByVal ElementType As esriNetworkElementType _
) As Integer
public int get_ElementCount (
    esriNetworkElementType ElementType
);

Remarks

The ElementCount is the number of network elements for the given network element type.

Edges: The count of edges includes hyperedges, as well as both directions of edges that share the same EID. For example, the edge with EID 1 and a direction of esriNetworkEdgeDirection.esriNEDAgainstDigitized and the edge with EID 1 and a direction of esriNetworkEdgeDirection.esriNEDAlongDigitized are counted as two separate edges.

Junctions: Every junction in the network dataset is included in the junction count.

Turns: The count of turns only includes turn features. Global turns are not included in the count.

INetworkQuery.Elements Property

Enumeration of all elements in the network dataset of the given type.

Public Function get_Elements ( _
    ByVal ElementType As esriNetworkElementType _
) As IEnumNetworkElement
public IEnumNetworkElement get_Elements (
    esriNetworkElementType ElementType
);

Remarks

The IEnumNetworkElement enumeration object returned by the Elements property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

For edge elements, the element(s) returned in the enumeration will be oriented in the esriNEDAlongDigitized Direction. To get the edge element in the esriNEDAgainstDigitized Direction, call INetworkEdge::QueryEdgeInOtherDirection on the returned edge.

INetworkQuery.ElementsByOID Property

Elements in the network dataset corresponding to the given source object.

Public Function get_ElementsByOID ( _
    ByVal SourceID As Integer, _
    ByVal OID As Integer _
) As IEnumNetworkElement
public IEnumNetworkElement get_ElementsByOID (
    int SourceID,
    int OID
);

Remarks

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

The IEnumNetworkElement enumeration object returned by the ElementsByOID property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

For edge elements, the element(s) returned in the enumeration will be oriented in the esriNEDAlongDigitized Direction. To get the edge element in the esriNEDAgainstDigitized Direction, call INetworkEdge::QueryEdgeInOtherDirection on the returned edge.

INetworkQuery.ElementsByOIDs Property

Elements in the network dataset corresponding to the given source objects.

Public Function get_ElementsByOIDs ( _
    ByVal SourceID As Integer, _
    ByVal oids As ILongArray _
) As IEnumNetworkElement
public IEnumNetworkElement get_ElementsByOIDs (
    int SourceID,
    ILongArray oids
);

Remarks

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

The IEnumNetworkElement enumeration object returned by the ElementsByOIDs property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

For edge elements, the element(s) returned in the enumeration will be oriented in the esriNEDAlongDigitized Direction. To get the edge element in the esriNEDAgainstDigitized Direction, call INetworkEdge::QueryEdgeInOtherDirection on the returned edge.

INetworkQuery.ElementsForSource Property

Enumeration of all elements in the network dataset corresponding to the given source.

Public Function get_ElementsForSource ( _
    ByVal SourceID As Integer _
) As IEnumNetworkElement
public IEnumNetworkElement get_ElementsForSource (
    int SourceID
);

Remarks

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

The IEnumNetworkElement enumeration object returned by the ElementsBySource property is recycling. For enumerations with more than one network element returned, this means that the network element object returned by the first call to Next is expected to be reused in subsequent calls to Next.

For edge elements, the element(s) returned in the enumeration will be oriented in the esriNEDAlongDigitized Direction. To get the edge element in the esriNEDAgainstDigitized Direction, call INetworkEdge::QueryEdgeInOtherDirection on the returned edge.

INetworkQuery.MaxEID Property

Highest element ID in the network dataset for the given element type.

Public Function get_MaxEID ( _
    ByVal ElementType As esriNetworkElementType _
) As Integer
public int get_MaxEID (
    esriNetworkElementType ElementType
);

Remarks

The MaxEID is the highest Element ID value in the network dataset for the given network element type.

INetworkQuery.MaxValence Property

Maximum number of edge elements connected to any single junction element.

Public ReadOnly Property MaxValence As Integer
public int MaxValence {get;}

Remarks

The MaxValence is the largest number of edge elements in the network that are adjacent to a single junction element.

INetworkQuery.PopulateIDCache Method

Initializes the index used for quickly finding network elements for the given source ID.

Public Sub PopulateIDCache ( _
    ByVal SourceID As Integer _
)
public void PopulateIDCache (
    int SourceID
);

Remarks

The PopulateIDCache method caches the IDs for network elements in the specified source, improving the performance of element queries. Populating the ID cache is useful when performing many queries for network elements within those cached source(s).

The SourceID parameter is the unique ID assigned to the INetworkSource in the network dataset.

INetworkQuery.QueryEdge Method

Performs a network edge element query by element ID and edge direction and populates the given edge element object.

Public Sub QueryEdge ( _
    ByVal EID As Integer, _
    ByVal Direction As esriNetworkEdgeDirection, _
    ByVal Edge As INetworkEdge _
)
public void QueryEdge (
    int EID,
    esriNetworkEdgeDirection Direction,
    INetworkEdge Edge
);

Remarks

The QueryEdge method requires an instantiated NetworkEdge object to be passed in as a parameter. You can create an empty NetworkEdge object by using the CreateNetworkElement method.

INetworkQuery.QueryJunction Method

Performs a network junction element query by element ID and populates the given junction element object.

Public Sub QueryJunction ( _
    ByVal EID As Integer, _
    ByVal Junction As INetworkJunction _
)
public void QueryJunction (
    int EID,
    INetworkJunction Junction
);

Remarks

The QueryJunction method requires an instantiated NetworkJunction object to be passed in as a parameter. You can create an empty NetworkJunction object by using the CreateNetworkElement method.

INetworkQuery.QueryTurn Method

Performs a network turn element query by element ID and populates the given turn element object.

Public Sub QueryTurn ( _
    ByVal EID As Integer, _
    ByVal Turn As INetworkTurn _
)
public void QueryTurn (
    int EID,
    INetworkTurn Turn
);

Remarks

The QueryTurn method requires an instantiated NetworkTurn object to be passed in as a parameter. You can create an empty NetworkTurn object by using the CreateNetworkElement method.

INetworkQuery.RefreshDynamicTrafficData Method

Refreshes the current dynamic traffic data referenced by the network dataset based on the specified time and usage.

Public Sub RefreshDynamicTrafficData ( _
    ByVal utcTime As DateTime, _
    ByVal utcTimeUsage As esriNetworkTimeUsage, _
    ByRef pDynamicTrafficUTCStartTime As DateTime&, _
    ByRef pDynamicTrafficUTCEndTime As DateTime& _
)
public void RefreshDynamicTrafficData (
    DateTime utcTime,
    esriNetworkTimeUsage utcTimeUsage,
    ref DateTime& pDynamicTrafficUTCStartTime,
    ref DateTime& pDynamicTrafficUTCEndTime
);

INetworkQuery.TimeZoneID Property

The time zone ID for the given network element.

Public Function get_TimeZoneID ( _
    ByVal networkElement As INetworkElement _
) As Integer
public int get_TimeZoneID (
    INetworkElement networkElement
);

Classes that implement INetworkQuery

Classes Description

Remarks

The INetworkQuery interface is used to retrieve the elements of the network dataset. You can query for network elements by their element type, by the source that generated them, or by the Object IDs of their source features.

You can also query other elements that are immediately adjacent to given elements by using the INetworkForwardStar object. This object allows you to repeatedly query the adjacent elements and their attribute values efficiently.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.