Class TurnFeatureSourceClass

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll
[ClassInterface(ClassInterfaceType.None)]
[Guid("44BB047B-C080-4597-B36B-E56905983C4C")]
public class TurnFeatureSourceClass : TurnFeatureSource, INetworkSource, ITurnFeatureSource
Inheritance
TurnFeatureSourceClass
Implements
Inherited Members

Constructors

TurnFeatureSourceClass()

public TurnFeatureSourceClass()

Explicit Interface Implementations

ElementType

Network element type of this network source.

virtual esriNetworkElementType ElementType { get; set; }

Returns

esriNetworkElementType

GeometryType

The enumerated geometry type.

virtual esriGeometryType GeometryType { get; }

Returns

esriGeometryType

ID

Unique identifier of this network source.

virtual int ID { get; }

Returns

int

Remarks

Each source in a Network Dataset is identified by a unique value, the ID property.  The ID property can be used to get a reference to the corresponding network source through the INetworkDataset::SourceByID property.  This ID is different than the ID value returned by the IObjectClass::ObjectClassID property.

As with ObjectID values, SourceID values are never reused.  They are not guaranteed to be sequential, but are guaranteed to be in increasing order based on when the source was added to the network.  Unless the source is added or deleted from the DataElement, the SourceID values will remain constant after the INetworkDataset::UpdateSchema method is called.

Name

Name of the class associated with this network source.

virtual string Name { get; set; }

Returns

string

Remarks

As the network source and its associated feature class (or table) have the same name, it's possible to use this mapping to retrieve the source from any given layer.

[C#]

// The following code shows how to retrieve a network source based on the feature class name

int layerId = 0;

// Get the feature class associated with the specific layer

IMapServer ms = (MapServer)serverObjectHelper.ServerObject;

IMapServerDataAccess mapServerDataAccess = (IMapServerDataAccess)serverObjectHelper.ServerObject;

IMapServerInfo mapServerInfo = ms.GetServerInfo(ms.DefaultMapName);

IFeatureClass fc = (IFeatureClass)mapServerDataAccess.GetDataSource(ms.DefaultMapName, layerId);

IDataset ds = (IDataset)fc;

// Get the UN domain networks and loop through the network sources to find the one matching the feature class

IDatasetComponent dsComponent = (IDatasetComponent)unDataset;

IDEDataset dataElement = dsComponent.DataElement;

IDEBaseNetwork bnDataElement = (IDEBaseNetwork)dataElement;

IDEUtilityNetwork unDataElement = (IDEUtilityNetwork)bnDataElement;

IArray domainNetworks = unDataElement.DomainNetworks;

INetworkSource ns = null;

for (int i = 0; i < domainNetworks.Count; i++)

{

  IDomainNetwork dn = (IDomainNetwork)domainNetworks.Element[i];

  IArray networkSources = dn.Sources;

  for (int j = 0; j < networkSources.Count; j++)

  {

    INetworkSource currentNS = (INetworkSource) networkSources.Element[j];

    if(currentNS.Name == ds.Name)

    {

      ns = currentNS;

      break;

    }

  }

  if (ns != null)

    break;

}

NetworkSourceDirections

The directions settings for this network source.

virtual INetworkSourceDirections NetworkSourceDirections { get; set; }

Returns

INetworkSourceDirections

Remarks

The NetworkSourceDirections property specifies the information needed to generate driving directions when reporting routes traversing elements from this INetworkSource.

Properties

Property set of this network source.

virtual IPropertySet Properties { get; set; }

Returns

IPropertySet

SourceType

Type of network source.

virtual esriNetworkSourceType SourceType { get; }

Returns

esriNetworkSourceType

UsesGeometryInConnectivity

Indicates if the source object's geometry is used in determining network connectivity.

virtual bool UsesGeometryInConnectivity { get; set; }

Returns

bool

Remarks

The UsesGeometryInConnectivity property indicates whether the geometries of the features in an INetworkSource  are used in determining how its network elements are connected to each other.

For example, the geometries of the features in an EdgeFeatureSource and JunctionFeatureSource are used to determine how the generated edge and junction elements connect to each other.  The UsesGeometryInConnectivity property for these sources is True.

In contrast, the geometries of the features in a TurnFeatureSource are not used in deteriming how the turn elements are associated with the edges and junctions of the network -- the fields of the TurnFeatureSource feature class determine this.  The UsesGeometryInConnectivity property for the TurnFeatureSource is False.