ArcObjects Library Reference (NetworkAnalyst)  

INAClassFieldMap Interface

Provides access to the the mapping of input fields to output fields.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Members

Description
Read-only property Count The count of field mappings defined.
Method CreateMapping Creates a new field name mapping.
Read/write property DefaultValue The default field value for a given input field name.
Read-only property FieldName The mapping for the given index.
Read/write property MappedField The output field name mapped to a given input field name.
Method Remove Removes the entry for an existing field name mapping.

CoClasses that implement INAClassFieldMap

CoClasses and Classes Description
NAClassFieldMap Defines one field mapping.

Remarks

The INAClassFieldMap interface provides access to a collection of field map items.  When used with NAClassLoader::Load, each field map item associates a field in the input row with a field in a NAClass.

The DefaultValue property is used when the input row has a null field value or no field mapping is specified.

[C#]

// Map the "Name" field of a Stops NAClass to the "Restaurant" field of an input feature class

ESRI.ArcGIS.NetworkAnalyst.INAClass stopsClass = naContext.NAClasses.get_ItemByName("Stops") as ESRI.ArcGIS.NetworkAnalyst.INAClass;

ESRI.ArcGIS.NetworkAnalyst.INAClassFieldMap naClassFieldMap = new ESRI.ArcGIS.NetworkAnalyst.NAClassFieldMapClass();

naClassFieldMap.CreateMapping(stopsClass.ClassDefinition, inputFeatureClass.Fields);

naClassFieldMap.set_MappedField("Name", "Restaurant");

[Visual Basic .NET]
' set up field map 
Dim stopsClass As INAClass =  naContext.NAClasses.ItemByName("Stops")
Dim naClassFieldMap As INAClassFieldMap =  New NAClassFieldMap() 
naClassFieldMap.CreateMapping(stopsClass.ClassDefinition, inputFeatureClass.Fields)
naClassFieldMap.MappedField("Name") = "Restaurant"