Interface INetworkQuery
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that query the elements of the network dataset.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("73BED6FC-FDA9-45B0-A82D-1B42D52A26D0")]
public interface INetworkQuery
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.
Properties
ComplexTurnCount
Number of turn elements in the network dataset having more than two edge elements participating.
int ComplexTurnCount { get; }
Property Value
Remarks
The ComplexTurnCount is the number of turn elements that traverse three or more edge elements in the network.
EdgesByPosition[int, long, double]
Edge elements in the network dataset with a from and to position that includes the given position for the given source object.
IEnumNetworkElement EdgesByPosition[int SourceID, long OID, double Position] { get; }
Parameters
Property Value
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.
EdgesBySegment[int, long, double, double]
Edge elements in the network dataset with a from and to position included in the given range for the given source object.
IEnumNetworkElement EdgesBySegment[int SourceID, long OID, double fromPosition, double toPosition] { get; }
Parameters
Property Value
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.
ElementCount[esriNetworkElementType]
Number of network elements of the given type in the network dataset.
int ElementCount[esriNetworkElementType ElementType] { get; }
Parameters
ElementTypeesriNetworkElementType
Property Value
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.
Elements[esriNetworkElementType]
Enumeration of all elements in the network dataset of the given type.
IEnumNetworkElement Elements[esriNetworkElementType ElementType] { get; }
Parameters
ElementTypeesriNetworkElementType
Property Value
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.
ElementsByOID[int, long]
Elements in the network dataset corresponding to the given source object.
IEnumNetworkElement ElementsByOID[int SourceID, long OID] { get; }
Parameters
Property Value
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.
ElementsByOIDs[int, ILongLongArray]
Elements in the network dataset corresponding to the given source objects.
IEnumNetworkElement ElementsByOIDs[int SourceID, ILongLongArray oids] { get; }
Parameters
SourceIDintoidsILongLongArray
Property Value
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.
ElementsForSource[int]
Enumeration of all elements in the network dataset corresponding to the given source.
IEnumNetworkElement ElementsForSource[int SourceID] { get; }
Parameters
SourceIDint
Property Value
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.
MaxEID[esriNetworkElementType]
Highest element ID in the network dataset for the given element type.
long MaxEID[esriNetworkElementType ElementType] { get; }
Parameters
ElementTypeesriNetworkElementType
Property Value
Remarks
The MaxEID is the highest Element ID value in the network dataset for the given network element type.
MaxValence
Maximum number of edge elements connected to any single junction element.
int MaxValence { get; }
Property Value
Remarks
The MaxValence is the largest number of edge elements in the network that are adjacent to a single junction element.
TimeZoneID[INetworkElement]
The time zone ID for the given network element.
int TimeZoneID[INetworkElement networkElement] { get; }
Parameters
networkElementINetworkElement
Property Value
Methods
ClearIDCache()
Empties the contents of the index used for finding network elements by source.
void ClearIDCache()
ConvertLocalTimeToUTCTime(int, DateTime)
Converts local time for the given time zone to UTC time.
DateTime ConvertLocalTimeToUTCTime(int localTimeZoneID, DateTime localTime)
Parameters
Returns
ConvertUTCTimeToLocalTime(int, DateTime)
Converts UTC time to local time for the given time zone.
DateTime ConvertUTCTimeToLocalTime(int localTimeZoneID, DateTime utcTime)
Parameters
Returns
CreateForwardStar()
Creates a NetworkForwardStar object for traversing the network dataset.
INetworkForwardStar CreateForwardStar()
Returns
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.
CreateForwardStarAdjacencies()
Creates a NetworkForwardStarAdjacencies container object for forward star queries.
INetworkForwardStarAdjacencies CreateForwardStarAdjacencies()
Returns
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
CreateNetworkElement(esriNetworkElementType)
Creates an uninitialized network element of the specified type for use in network dataset queries.
INetworkElement CreateNetworkElement(esriNetworkElementType ElementType)
Parameters
ElementTypeesriNetworkElementType
Returns
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.
PopulateIDCache(int)
Initializes the index used for quickly finding network elements for the given source ID.
void PopulateIDCache(int SourceID)
Parameters
SourceIDint
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.
QueryEdge(long, esriNetworkEdgeDirection, INetworkEdge)
Performs a network edge element query by element ID and edge direction and populates the given edge element object.
void QueryEdge(long EID, esriNetworkEdgeDirection Direction, INetworkEdge Edge)
Parameters
EIDlongDirectionesriNetworkEdgeDirectionEdgeINetworkEdge
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.
QueryJunction(long, INetworkJunction)
Performs a network junction element query by element ID and populates the given junction element object.
void QueryJunction(long EID, INetworkJunction Junction)
Parameters
EIDlongJunctionINetworkJunction
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.
QueryTurn(long, INetworkTurn)
Performs a network turn element query by element ID and populates the given turn element object.
void QueryTurn(long EID, INetworkTurn Turn)
Parameters
EIDlongTurnINetworkTurn
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.
RefreshDynamicTrafficData(DateTime, esriNetworkTimeUsage, out DateTime, out DateTime)
Refreshes the current dynamic traffic data referenced by the network dataset based on the specified time and usage.
void RefreshDynamicTrafficData(DateTime utcTime, esriNetworkTimeUsage utcTimeUsage, out DateTime pDynamicTrafficUTCStartTime, out DateTime pDynamicTrafficUTCEndTime)
Parameters
utcTimeDateTimeutcTimeUsageesriNetworkTimeUsagepDynamicTrafficUTCStartTimeDateTimepDynamicTrafficUTCEndTimeDateTime