com.esri.arcgis.geodatabase
Interface INetworkQuery

All Superinterfaces:
Serializable
All Known Subinterfaces:
INetworkQuery2
All Known Implementing Classes:
INetworkQuery2Proxy, INetworkQueryProxy, NetworkDataset

public interface INetworkQuery
extends Serializable

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

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 NetworkForwardStar object. This object allows you to repeatedly query the adjacent elements and their attribute values efficiently.

Product Availability

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


Method Summary
 void clearIDCache()
          Empties the contents of the index used for finding network elements by source.
 INetworkForwardStar createForwardStar()
          Creates a NetworkForwardStar object for traversing the network dataset.
 INetworkForwardStarAdjacencies createForwardStarAdjacencies()
          Creates a NetworkForwardStarAdjacencies container object for forward star queries.
 INetworkElement createNetworkElement(int elementType)
          Creates an uninitialized network element of the specified type for use in network dataset queries.
 int getComplexTurnCount()
          Number of turn elements in the network dataset having more than two edge elements participating.
 IEnumNetworkElement getEdgesByPosition(int sourceID, int oID, double position, boolean includeRelatedSDCHyperEdges)
          Edge elements in the network dataset with a from and to position that includes the given position for the given source object.
 IEnumNetworkElement getEdgesBySegment(int sourceID, int oID, double fromPosition, double toPosition)
          Edge elements in the network dataset with a from and to position included in the given range for the given source object.
 int getElementCount(int elementType)
          Number of network elements of the given type in the network dataset.
 IEnumNetworkElement getElements(int elementType)
          Enumeration of all elements in the network dataset of the given type.
 IEnumNetworkElement getElementsByOID(int sourceID, int oID)
          Elements in the network dataset corresponding to the given source object.
 IEnumNetworkElement getElementsByOIDs(int sourceID, ILongArray oids)
          Elements in the network dataset corresponding to the given source objects.
 IEnumNetworkElement getElementsForSource(int sourceID)
          Enumeration of all elements in the network dataset corresponding to the given source.
 int getMaxEID(int elementType)
          Highest element ID in the network dataset for the given element type.
 int getMaxValence()
          Maximum number of edge elements connected to any single junction element.
 void populateIDCache(int sourceID)
          Initializes the index used for quickly finding network elements for the given source ID.
 void queryEdge(int eID, int direction, INetworkEdge edge)
          Performs a network edge element query by element ID and edge direction and populates the given edge element object.
 void queryJunction(int eID, INetworkJunction junction)
          Performs a network junction element query by element ID and populates the given junction element object.
 void queryTurn(int eID, INetworkTurn turn)
          Performs a network turn element query by element ID and populates the given turn element object.
 

Method Detail

getMaxEID

int getMaxEID(int elementType)
              throws IOException,
                     AutomationException
Highest element ID in the network dataset for the given element type.

Product Availability

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

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
Returns:
The maxEID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxValence

int getMaxValence()
                  throws IOException,
                         AutomationException
Maximum number of edge elements connected to any single junction element.

Remarks

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

Product Availability

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

Returns:
The maxValence
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementCount

int getElementCount(int elementType)
                    throws IOException,
                           AutomationException
Number of network elements of the given type in the network dataset.

Product Availability

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

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
Returns:
The elementCount
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getComplexTurnCount

int getComplexTurnCount()
                        throws IOException,
                               AutomationException
Number of turn elements in the network dataset having more than two edge elements participating.

Remarks

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

Product Availability

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

Returns:
The complexTurnCount
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createForwardStar

INetworkForwardStar createForwardStar()
                                      throws IOException,
                                             AutomationException
Creates a NetworkForwardStar object for traversing the network dataset.

Remarks

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

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

Product Availability

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

Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkForwardStar
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createForwardStarAdjacencies

INetworkForwardStarAdjacencies createForwardStarAdjacencies()
                                                            throws IOException,
                                                                   AutomationException
Creates a NetworkForwardStarAdjacencies container object for forward star queries.

Remarks

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

Product Availability

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

Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkForwardStarAdjacencies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createNetworkElement

INetworkElement createNetworkElement(int elementType)
                                     throws IOException,
                                            AutomationException
Creates an uninitialized network element of the specified type for use in network dataset queries.

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.

Product Availability

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

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.INetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryEdge

void queryEdge(int eID,
               int direction,
               INetworkEdge edge)
               throws IOException,
                      AutomationException
Performs a network edge element query by element ID and edge direction and populates the given edge element object.

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.

Product Availability

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

Parameters:
eID - The eID (in)
direction - A com.esri.arcgis.geodatabase.esriNetworkEdgeDirection constant (in)
edge - A reference to a com.esri.arcgis.geodatabase.INetworkEdge (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryJunction

void queryJunction(int eID,
                   INetworkJunction junction)
                   throws IOException,
                          AutomationException
Performs a network junction element query by element ID and populates the given junction element object.

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.

Product Availability

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

Parameters:
eID - The eID (in)
junction - A reference to a com.esri.arcgis.geodatabase.INetworkJunction (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryTurn

void queryTurn(int eID,
               INetworkTurn turn)
               throws IOException,
                      AutomationException
Performs a network turn element query by element ID and populates the given turn element object.

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.

Product Availability

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

Parameters:
eID - The eID (in)
turn - A reference to a com.esri.arcgis.geodatabase.INetworkTurn (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementsByOID

IEnumNetworkElement getElementsByOID(int sourceID,
                                     int oID)
                                     throws IOException,
                                            AutomationException
Elements in the network dataset corresponding to the given source object.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
oID - The oID (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEdgesByPosition

IEnumNetworkElement getEdgesByPosition(int sourceID,
                                       int oID,
                                       double position,
                                       boolean includeRelatedSDCHyperEdges)
                                       throws IOException,
                                              AutomationException
Edge elements in the network dataset with a from and to position that includes the given position for the given source object.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
oID - The oID (in)
position - The position (in)
includeRelatedSDCHyperEdges - The includeRelatedSDCHyperEdges (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEdgesBySegment

IEnumNetworkElement getEdgesBySegment(int sourceID,
                                      int oID,
                                      double fromPosition,
                                      double toPosition)
                                      throws IOException,
                                             AutomationException
Edge elements in the network dataset with a from and to position included in the given range for the given source object.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
oID - The oID (in)
fromPosition - The fromPosition (in)
toPosition - The toPosition (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElements

IEnumNetworkElement getElements(int elementType)
                                throws IOException,
                                       AutomationException
Enumeration of all elements in the network dataset of the given type.

Product Availability

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

Parameters:
elementType - A com.esri.arcgis.geodatabase.esriNetworkElementType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementsByOIDs

IEnumNetworkElement getElementsByOIDs(int sourceID,
                                      ILongArray oids)
                                      throws IOException,
                                             AutomationException
Elements in the network dataset corresponding to the given source objects.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
oids - A reference to a com.esri.arcgis.system.ILongArray (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getElementsForSource

IEnumNetworkElement getElementsForSource(int sourceID)
                                         throws IOException,
                                                AutomationException
Enumeration of all elements in the network dataset corresponding to the given source.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumNetworkElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearIDCache

void clearIDCache()
                  throws IOException,
                         AutomationException
Empties the contents of the index used for finding network elements by source.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

populateIDCache

void populateIDCache(int sourceID)
                     throws IOException,
                            AutomationException
Initializes the index used for quickly finding network elements for the given source ID.

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 NetworkSource in the network dataset.

Product Availability

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

Parameters:
sourceID - The sourceID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.