Defines how fields should be mapped as inputs and outputs of analysis functions.
Product Availability
Interfaces
Interfaces | Description |
---|---|
IClone (esriSystem) | Provides access to members that control cloning of objects. |
INAClassDefinition | Provides access to properties common to all network analyst class definitions. |
INAClassDefinition2 | Provides access to properties common to all network analyst class definitions. |
INAClassDefinitionEdit | Provides access to editable properties common to all network analyst class definitions. |
IPersistStream (esriSystem) | |
IXMLSerialize (esriSystem) | Provides access to members that XML serialize and deserialize an object to/from XML. |
Remarks
The NAClassDefinition is created and maintained by the network solver. The NAClassDefinition holds information about how the NAClass fields should be created when the solver creates the NAContext and corresponding NAClass objects. It also holds additional information about the fields of the NAClass that cannot be found on the IField interface. This information is used by the solver and the Network Analyst Tools.
There are three ways to obtain NAClassDefinition objects:
- A NAClassDefinition object can also be
obtained from the NAClass object via the
INAClass.ClassDefinition property. The
NAClass objects are obtained from a
NAContext object via the
INAContext.NAClasses property. In this case,
the class definitions are associated with
a NAContext's NAClass, and
therefore have some properties populated that wouldn't be
otherwise. In C#:
INASolver naSolver = new NARouteSolverClass();
INAContext naContext = naSolver.CreateContext(deNetworkDataset, "My Context");
INamedSet naClasses = naContext.NAClasses;
INAClass naClass = naClasses.get_ItemByName("Stops") as INAClass;
INAClassDefinition naClassDefinition = naClass.ClassDefinition;
- A set of NAClassDefinitions can be obtained
from a NASolver object, via the
INASolver.ClassDefinitions property. In this
case, the class definitions are a kind of template or default that
is not associated with a live NAClass involved in
analysis. Some properties, like
CandidateFieldNames and the network dataset
specific Fields, will not be populated.
In C#:
INASolver naSolver= new NARouteSolverClass();
INamedSet naClassDefinitions = naSolver.ClassDefinitions;
INAClassDefinition naClassDefinition = naClassDefinitions.get_ItemByName("Stops") as INAClassDefinition;
- The NAClassDefinition object can be
CoCreated manually. In this case, the properties will be
empty. This might be done, for example, to create your
own class definitions for use with a custom solver. In
C#:
INAClassDefinition naClassDef = new NAClassDefinitionClass ();