ArcObjects Library Reference  (GeoDatabase)    

IGeometricNetwork.SearchForNetworkFeature Method

The NetworkFeatures found at the point.

[Visual Basic 6.0]
Function SearchForNetworkFeature(
    ByVal location As IPoint, _
    ByVal Type As esriFeatureType _
) As IEnumFeature
[Visual Basic .NET]
Public Function SearchForNetworkFeature ( _
    ByVal location As IPoint, _
    ByVal Type As esriFeatureType _
) As IEnumFeature
[C#]
public IEnumFeature SearchForNetworkFeature (
    IPoint location,
    esriFeatureType Type
);
[Java]
public IEnumFeature searchForNetworkFeature (
    IPoint location,
    esriFeatureType Type
)
throws
    IOException,
    AutomationException
[C++]
HRESULT SearchForNetworkFeature(
  IPoint* location,
  esriFeatureType Type,
  IEnumFeature** features
);
[C++]

Parameters

location [in]

  location is a parameter of type IPoint

Type [in]

  Type is a parameter of type esriFeatureType

features [out, retval]

  features is a parameter of type IEnumFeature

Product Availability

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

Remarks

The SearchForNetworkFeature method returns an enumeration of the specified type of network feature located at the supplied point.  If more than one feature is coincident with the point, then all are returned. The returned features may span different classes; the only restriction is that all features must be of the same feature type. There is no guarantee as to the order of the returned features.

[C#]     public void IGeometricNetwork__SearchForNetworkFeature(IGeometricNetwork geometricNetwork, ESRI.ArcGIS.Geometry.IPoint point)
    {
        //In order to return all network feature at a given location SearchForNetworkFeatures must be called once for each type of network feature.
        IEnumFeature simpleJunctionFeatures = geometricNetwork.SearchForNetworkFeature(point, esriFeatureType.esriFTSimpleJunction);
        IEnumFeature simpleEdgeFeatures = geometricNetwork.SearchForNetworkFeature(point, esriFeatureType.esriFTSimpleEdge);
        IEnumFeature complexEdgeFeatures = geometricNetwork.SearchForNetworkFeature(point, esriFeatureType.esriFTComplexEdge);
    }

[Visual Basic 6.0]

In order to return all network features at a given location, SearchForNetworkFeature must be called once for each type of network feature.  This is demonstrated in the following VBA code fragment.

'Assume we already have a point (pPoint) and a geometric network (pGN) pointer
Dim pSJFs as IEnumFeature
Dim pSEFs as IEnumFeature
Dim pCEFs as IEnumFeature

'Query for each of the network feature types
Set pSJFs = pGN.SearchForNetworkFeatures(pPoint, esriFTSimpleJunction)
Set pSEFs = pGN.SearchForNetworkFeatures(pPoint, esriFTSimpleEdge)
Set pCEFs = pGN.SearchForNetworkFeatures(pPoint, esriFTComplexEdge)

See Also

IGeometricNetwork Interface

 


Feedback Send feedback on this page