Exemplo n.º 1
0
        public void LoadNANetworkLocations(string strNAClassName, IFeatureClass pInputFC, double SnapTolerance)
        {
            INAClass class2 = this.m_pNAContext.NAClasses.get_ItemByName(strNAClassName) as INAClass;

            class2.DeleteAllRows();
            INAClassLoader loader = new NAClassLoaderClass
            {
                Locator = this.m_pNAContext.Locator
            };

            if (SnapTolerance > 0.0)
            {
                loader.Locator.SnapTolerance = SnapTolerance;
            }
            loader.NAClass = class2;
            INAClassFieldMap map = new NAClassFieldMapClass();

            map.CreateMapping(class2.ClassDefinition, pInputFC.Fields);
            loader.FieldMap = map;
            int            rowsInCursor = 0;
            int            rowsLocated  = 0;
            IFeatureCursor cursor       = pInputFC.Search(null, true);

            loader.Load((ICursor)cursor, null, ref rowsInCursor, ref rowsLocated);
        }
		/// <summary>
		/// Set solver settings
		/// </summary>
		/// <param name="strNAClassName">NAClass name</param>
		/// <param name="inputFC">Input feature class</param>
        /// <param name="maxSnapTolerance">Max snap tolerance</param>
        public void LoadNANetworkLocations(string strNAClassName, IFeatureClass inputFC, double maxSnapTolerance)
        {
			INamedSet classes = m_NAContext.NAClasses;
			INAClass naClass = classes.get_ItemByName(strNAClassName) as INAClass;

			// Delete existing locations from the specified NAClass
			naClass.DeleteAllRows();

			// Create a NAClassLoader and set the snap tolerance (meters unit)
            INAClassLoader classLoader = new NAClassLoader();
            classLoader.Locator = m_NAContext.Locator;
            if (maxSnapTolerance > 0) ((INALocator3)classLoader.Locator).MaxSnapTolerance = maxSnapTolerance;
            classLoader.NAClass = naClass;

			// Create field map to automatically map fields from input class to NAClass
			INAClassFieldMap fieldMap = new NAClassFieldMapClass();
			fieldMap.CreateMapping(naClass.ClassDefinition, inputFC.Fields);
            classLoader.FieldMap = fieldMap;

			// Avoid loading network locations onto non-traversable portions of elements
			INALocator3 locator = m_NAContext.Locator as INALocator3;
			locator.ExcludeRestrictedElements = true;
			locator.CacheRestrictedElements(m_NAContext);

			// Load network locations
			int rowsIn = 0;
			int rowsLocated = 0;
            classLoader.Load((ICursor)inputFC.Search(null, true), null, ref rowsIn, ref rowsLocated);

			// Message all of the network analysis agents that the analysis context has changed.
            ((INAContextEdit)m_NAContext).ContextChanged();
        }
Exemplo n.º 3
0
        private bool LoadLocations(IFeatureWorkspace featureWorkspace)
        {
            IFeatureClass inputFeatureClass = null;

            try
            {
                inputFeatureClass = featureWorkspace.OpenFeatureClass(txtInputFacilities.Text);
            }
            catch (Exception)
            {
                MessageBox.Show("Specified input feature class does not exist");
                return(false);
            }

            INamedSet classes = m_naContext.NAClasses;
            INAClass  naClass = classes.get_ItemByName("Facilities") as INAClass;

            // delete existing locations, except barriers
            naClass.DeleteAllRows();

            // Create a NAClassLoader and set the snap tolerance (meters unit)
            INAClassLoader naClassLoader = new NAClassLoaderClass();

            naClassLoader.Locator = m_naContext.Locator;
            naClassLoader.Locator.SnapTolerance = 100;
            naClassLoader.NAClass = naClass;

            // Create field map to automatically map fields from input class to NAClass
            INAClassFieldMap naClassFieldMap = new NAClassFieldMapClass();

            naClassFieldMap.CreateMapping(naClass.ClassDefinition, inputFeatureClass.Fields);
            naClassLoader.FieldMap = naClassFieldMap;

            // Avoid loading network locations onto non-traversable portions of elements
            INALocator3 locator = m_naContext.Locator as INALocator3;

            locator.ExcludeRestrictedElements = true;
            locator.CacheRestrictedElements(m_naContext);

            // load network locations
            int rowsIn      = 0;
            int rowsLocated = 0;

            naClassLoader.Load(inputFeatureClass.Search(null, true) as ICursor, null, ref rowsIn, ref rowsLocated);

            if (rowsLocated <= 0)
            {
                MessageBox.Show("Facilities were not loaded from input feature class");
                MessageBox.Show("没有导入任何结果!");
                return(false);
            }

            // Message all of the network analysis agents that the analysis context has changed
            INAContextEdit naContextEdit = m_naContext as INAContextEdit;

            naContextEdit.ContextChanged();

            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create the analysis layer, load the locations, solve the analysis, and write to disk
        /// </summary>
        public void SolveRoute()
        {
            // Open the feature workspace, input feature class, and network dataset
            // As Workspace Factories are Singleton objects, they must be instantiated with the Activator
            IWorkspaceFactory workspaceFactory = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory")) as IWorkspaceFactory;
            IFeatureWorkspace featureWorkspace = workspaceFactory.OpenFromFile(Application.StartupPath + FGDB_WORKSPACE, 0) as IFeatureWorkspace;
            IFeatureClass     inputStopsFClass = featureWorkspace.OpenFeatureClass(INPUT_STOPS_FC);

            // Obtain the dataset container from the workspace
            ESRI.ArcGIS.Geodatabase.IFeatureDataset featureDataset = featureWorkspace.OpenFeatureDataset(FEATURE_DATASET);
            var featureDatasetExtensionContainer = featureDataset as ESRI.ArcGIS.Geodatabase.IFeatureDatasetExtensionContainer;

            ESRI.ArcGIS.Geodatabase.IFeatureDatasetExtension featureDatasetExtension = featureDatasetExtensionContainer.FindExtension(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTNetworkDataset);
            var datasetContainer3 = featureDatasetExtension as ESRI.ArcGIS.Geodatabase.IDatasetContainer3;

            // Use the container to open the network dataset.
            ESRI.ArcGIS.Geodatabase.IDataset dataset = datasetContainer3.get_DatasetByName(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTNetworkDataset, NETWORK_DATASET);
            INetworkDataset networkDataset           = dataset as INetworkDataset;

            // Create the Route NALayer
            INALayer      naLayer      = CreateRouteAnalysisLayer("Route", networkDataset);
            INAContext    naContext    = naLayer.Context;
            INAClass      stopsNAClass = naContext.NAClasses.get_ItemByName("Stops") as INAClass;
            IFeatureClass routesFC     = naContext.NAClasses.get_ItemByName("Routes") as IFeatureClass;

            // Load the Stops
            INAClassFieldMap naClassFieldMap = new NAClassFieldMapClass();

            naClassFieldMap.set_MappedField("Name", INPUT_NAME_FIELD);

            INAClassLoader naLoader = new NAClassLoaderClass();

            naLoader.Locator  = naContext.Locator;
            naLoader.NAClass  = stopsNAClass;
            naLoader.FieldMap = naClassFieldMap;

            // Avoid loading network locations onto non-traversable portions of elements
            INALocator3 locator = naContext.Locator as INALocator3;

            locator.ExcludeRestrictedElements = true;
            locator.CacheRestrictedElements(naContext);

            int rowsInCursor = 0;
            int rowsLocated  = 0;

            naLoader.Load(inputStopsFClass.Search(new QueryFilterClass(), false) as ICursor, new CancelTrackerClass(), ref rowsInCursor, ref rowsLocated);

            //Message all of the network analysis agents that the analysis context has changed
            ((INAContextEdit)naContext).ContextChanged();

            //Solve
            INASolver naSolver = naContext.Solver;

            naSolver.Solve(naContext, new GPMessagesClass(), new CancelTrackerClass());

            //Save the layer to disk
            SaveLayerToDisk(naLayer as ILayer, System.Environment.CurrentDirectory + @"\Route.lyr");
        }
Exemplo n.º 5
0
		//LoadNANetworkLocations
		public void LoadNANetworkLocations(string strNAClassName,IFeatureClass pInputFC,double SnapTolerance,ref INAContext m_pNAContext)
		{

			INAClass pNAClass;
			INamedSet pClasses;
			//get The collection of classes associated with the analysis
			pClasses = m_pNAContext.NAClasses;

			/*
			for(int ii=0;ii<pClasses.Count;ii++)
			{
				MessageBox.Show(pClasses.get_Name(ii));

			
			}
			*/
			
			pNAClass = pClasses.get_ItemByName(strNAClassName) as INAClass;

			//Remove all items added to the class (for example, stops or incidents).
			pNAClass.DeleteAllRows();

			// Create a NAClassLoader and set the snap tolerance (meters unit)
			//NAClassLoader to populate stop locations from a point feature class.

			INAClassLoader pLoader=new NAClassLoaderClass();

			pLoader.Locator = m_pNAContext.Locator;
			
			if( SnapTolerance > 0)
			{
				pLoader.Locator.SnapTolerance = SnapTolerance;

			}
			pLoader.NAClass = pNAClass;

			//Create field map to automatically map fields from input class to naclass
			INAClassFieldMap pFieldMap=new NAClassFieldMapClass();

			//pFieldMap.CreateMapping pNAClass.ClassDefinition, pInputFC.Fields;

			pFieldMap.CreateMapping(pNAClass.ClassDefinition,pInputFC.Fields);

			pLoader.FieldMap=pFieldMap;

			int rowsIn=0,rowsLocated=0;

			pLoader.Load(pInputFC.Search(null,true) as ICursor,null,ref rowsIn,ref rowsLocated);

	
		}
Exemplo n.º 6
0
        /// <summary>
        /// Load the input table and create field map to map fields from input table to NAClass
        /// </summary>
        /// <param name="strNAClassName">NAClass name</param>
        /// <param name="inputTable">Input table</param>
        public void LoadNANetworkLocations(string strNAClassName, ITable inputTable)
        {
            INamedSet classes = m_NAContext.NAClasses;
            INAClass  naClass = classes.get_ItemByName(strNAClassName) as INAClass;

            // Delete existing rows from the specified NAClass
            naClass.DeleteAllRows();

            // Create a NAClassLoader and set the snap tolerance (meters unit)
            INAClassLoader loader = new NAClassLoader();

            loader.Locator = m_NAContext.Locator;
            loader.Locator.SnapTolerance = 100;
            loader.NAClass = naClass;

            // Create field map to automatically map fields from input table to NAclass
            INAClassFieldMap fieldMap = new NAClassFieldMapClass();

            fieldMap.CreateMapping(naClass.ClassDefinition, inputTable.Fields);
            loader.FieldMap = fieldMap;


            // Avoid loading network locations onto non-traversable portions of elements
            INALocator3 locator = m_NAContext.Locator as INALocator3;

            locator.ExcludeRestrictedElements = true;
            locator.CacheRestrictedElements(m_NAContext);

            // Load input table
            int rowsIn      = 0;
            int rowsLocated = 0;

            loader.Load(inputTable.Search(null, true), null, ref rowsIn, ref rowsLocated);

            // Message all of the network analysis agents that the analysis context has changed.
            INAContextEdit naContextEdit = m_NAContext as INAContextEdit;

            naContextEdit.ContextChanged();
        }
Exemplo n.º 7
0
        private void Solve()
        {
            INALayer         layer     = this.CreateRouteAnalysisLayer("Route", this.m_pNetworkDataset);
            INAContext       nAContext = layer.Context;
            INAClass         class2    = nAContext.NAClasses.get_ItemByName("Stops") as INAClass;
            IFeatureClass    class3    = nAContext.NAClasses.get_ItemByName("Routes") as IFeatureClass;
            INAClassFieldMap map       = new NAClassFieldMapClass();

            map.set_MappedField("Name", this.SHAPE_INPUT_NAME_FIELD);
            INAClassLoader loader = new NAClassLoaderClass
            {
                Locator  = nAContext.Locator,
                NAClass  = class2,
                FieldMap = map
            };
            int rowsInCursor = 0;
            int rowsLocated  = 0;

            loader.Load(this.m_pInputStopsFClass.Search(new QueryFilterClass(), false) as ICursor,
                        new CancelTrackerClass(), ref rowsInCursor, ref rowsLocated);
            nAContext.Solver.Solve(nAContext, new GPMessagesClass(), new CancelTrackerClass());
            this.SaveLayerToDisk(layer as ILayer, Environment.CurrentDirectory + @"\Route.lyr");
        }
        /// <summary>
        /// 以图层的方法插入相关元素 如经过站点、障碍点、障碍线、障碍多边形等
        /// </summary>
        /// <param name="pNAContext">网络分析上下文</param>
        /// <param name="strNAClassName">Routes,Stops、Barriers、PolylineBarriers\PolygonBarriers</param>
        /// <param name="inputFeatuerClass">要素类</param>
        /// <param name="dSnapTolerance">阈值</param>
        public static void LoadNANetWorkLocations(INAContext pNAContext, string strNAClassName, IFeatureClass inputFeatuerClass, double dSnapTolerance)
        {
            INAClass  pNAClass;
            INamedSet pNamedSet;

            pNamedSet = pNAContext.NAClasses;
            pNAClass  = pNamedSet.get_ItemByName(strNAClassName) as INAClass;
            ISpatialFilter filer = new SpatialFilterClass();

            filer.WhereClause = "";
            int count = inputFeatuerClass.FeatureCount(filer as IQueryFilter);

            //删除已存在的元素
            pNAClass.DeleteAllRows();
            //创建NAClassLoader,设置捕捉容限值
            INAClassLoader pNAClassLoader = new NAClassLoaderClass();

            pNAClassLoader.Locator = pNAContext.Locator;
            if (dSnapTolerance > 0)
            {
                pNAClassLoader.Locator.SnapTolerance = dSnapTolerance;
            }
            pNAClassLoader.NAClass = pNAClass;
            //字段匹配
            INAClassFieldMap pNAClassFieldMap = new NAClassFieldMapClass();

            pNAClassFieldMap.CreateMapping(pNAClass.ClassDefinition, inputFeatuerClass.Fields);
            pNAClassLoader.FieldMap = pNAClassFieldMap;
            //加载要素类数据
            int            iRows          = 0;
            int            iRowsLocated   = 0;
            IFeatureCursor pFeatureCursor = inputFeatuerClass.Search(null, true);

            pNAClassLoader.Load((ICursor)pFeatureCursor, null, ref iRows, ref iRowsLocated);
            ((INAContextEdit)pNAContext).ContextChanged();
        }
        /// <summary>
        /// Find and load the cost attributes into a combo box
        /// <summary>
        /// <param name="featureWorkspace">The workspace that holds the input feature class</param>
        /// <returns>Success</returns>
        private bool LoadLocations(IFeatureWorkspace featureWorkspace)
		{
			IFeatureClass inputFeatureClass = null;
			try
			{
				inputFeatureClass = featureWorkspace.OpenFeatureClass(txtInputFacilities.Text);
			}
			catch (Exception)
			{
				MessageBox.Show("Specified input feature class does not exist");
				return false;
			}

			INamedSet classes = m_NAContext.NAClasses;
			INAClass naClass = classes.get_ItemByName("Facilities") as INAClass;

			// delete existing locations, except barriers
			naClass.DeleteAllRows();

			// Create a NAClassLoader and set the snap tolerance (meters unit)
			INAClassLoader naClassLoader = new NAClassLoaderClass();
			naClassLoader.Locator = m_NAContext.Locator;
			((INALocator3)naClassLoader.Locator).MaxSnapTolerance = 500;
			naClassLoader.NAClass = naClass;

			// Create field map to automatically map fields from input class to NAClass
			INAClassFieldMap naClassFieldMap = new NAClassFieldMapClass();
			naClassFieldMap.CreateMapping(naClass.ClassDefinition, inputFeatureClass.Fields);
			naClassLoader.FieldMap = naClassFieldMap;

			// Avoid loading network locations onto non-traversable portions of elements
			INALocator3 locator = m_NAContext.Locator as INALocator3;
			locator.ExcludeRestrictedElements = true;
			locator.CacheRestrictedElements(m_NAContext);

			// load network locations
			int rowsIn = 0;
			int rowsLocated = 0;
			naClassLoader.Load(inputFeatureClass.Search(null, true) as ICursor, null, ref rowsIn, ref rowsLocated);

			if (rowsLocated <= 0)
			{
				MessageBox.Show("Facilities were not loaded from input feature class");
				return false;
			}

			// Message all of the network analysis agents that the analysis context has changed
			INAContextEdit naContextEdit = m_NAContext as INAContextEdit;
			naContextEdit.ContextChanged();

			return true;
		}
		/// <summary>
		/// Set solver settings
		/// </summary>
		/// <param name="strNAClassName">NAClass name</param>
		/// <param name="inputFC">Input feature class</param>
        /// <param name="maxSnapTolerance">Max snap tolerance</param>
        public void LoadNANetworkLocations(string strNAClassName, IFeatureClass inputFC, double maxSnapTolerance)
        {
			INamedSet classes = m_NAContext.NAClasses;
			INAClass naClass = classes.get_ItemByName(strNAClassName) as INAClass;

			// Delete existing locations from the specified NAClass
			naClass.DeleteAllRows();

			// Create a NAClassLoader and set the snap tolerance (meters unit)
            INAClassLoader classLoader = new NAClassLoader();
            classLoader.Locator = m_NAContext.Locator;
            if (maxSnapTolerance > 0) ((INALocator3)classLoader.Locator).MaxSnapTolerance = maxSnapTolerance;
            classLoader.NAClass = naClass;

			// Create field map to automatically map fields from input class to NAClass
			INAClassFieldMap fieldMap = new NAClassFieldMapClass();
			fieldMap.CreateMapping(naClass.ClassDefinition, inputFC.Fields);
            classLoader.FieldMap = fieldMap;

			// Avoid loading network locations onto non-traversable portions of elements
			INALocator3 locator = m_NAContext.Locator as INALocator3;
			locator.ExcludeRestrictedElements = true;
			locator.CacheRestrictedElements(m_NAContext);

			// Load network locations
			int rowsIn = 0;
			int rowsLocated = 0;
            classLoader.Load((ICursor)inputFC.Search(null, true), null, ref rowsIn, ref rowsLocated);

			// Message all of the network analysis agents that the analysis context has changed.
            ((INAContextEdit)m_NAContext).ContextChanged();
        }
		/// <summary>
		/// Load the input table and create field map to map fields from input table to NAClass
		/// </summary>
		/// <param name="strNAClassName">NAClass name</param>
		/// <param name="inputTable">Input table</param>
		public void LoadNANetworkLocations(string strNAClassName, ITable inputTable)
		{
			INamedSet classes = m_NAContext.NAClasses;
			INAClass naClass = classes.get_ItemByName(strNAClassName) as INAClass;

			// Delete existing rows from the specified NAClass
			naClass.DeleteAllRows();

			// Create a NAClassLoader and set the snap tolerance (meters unit)
			INAClassLoader loader = new NAClassLoader();
			loader.Locator = m_NAContext.Locator;
			loader.Locator.SnapTolerance = 100;
			loader.NAClass = naClass;

			// Create field map to automatically map fields from input table to NAclass
			INAClassFieldMap fieldMap = new NAClassFieldMapClass();
			fieldMap.CreateMapping(naClass.ClassDefinition, inputTable.Fields);
			loader.FieldMap = fieldMap;


			// Avoid loading network locations onto non-traversable portions of elements
			INALocator3 locator = m_NAContext.Locator as INALocator3;
			locator.ExcludeRestrictedElements = true;
			locator.CacheRestrictedElements(m_NAContext);

			// Load input table
			int rowsIn = 0;
			int rowsLocated = 0;
			loader.Load(inputTable.Search(null, true), null, ref rowsIn, ref rowsLocated);

			// Message all of the network analysis agents that the analysis context has changed.
			INAContextEdit naContextEdit = m_NAContext as INAContextEdit;
			naContextEdit.ContextChanged();
		}
		/// <summary>
		/// Create the analysis layer, load the locations, solve the analysis, and write to disk
		/// </summary>
		public void SolveRoute()
		{
			// Open the feature workspace, input feature class, and network dataset
			// As Workspace Factories are Singleton objects, they must be instantiated with the Activator
			IWorkspaceFactory workspaceFactory = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory")) as IWorkspaceFactory;
			IFeatureWorkspace featureWorkspace = workspaceFactory.OpenFromFile(Application.StartupPath + FGDB_WORKSPACE, 0) as IFeatureWorkspace;
			IFeatureClass inputStopsFClass = featureWorkspace.OpenFeatureClass(INPUT_STOPS_FC);

			// Obtain the dataset container from the workspace
			ESRI.ArcGIS.Geodatabase.IFeatureDataset featureDataset = featureWorkspace.OpenFeatureDataset(FEATURE_DATASET);
			var featureDatasetExtensionContainer = featureDataset as ESRI.ArcGIS.Geodatabase.IFeatureDatasetExtensionContainer;
			ESRI.ArcGIS.Geodatabase.IFeatureDatasetExtension featureDatasetExtension = featureDatasetExtensionContainer.FindExtension(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTNetworkDataset);
			var datasetContainer3 = featureDatasetExtension as ESRI.ArcGIS.Geodatabase.IDatasetContainer3;

			// Use the container to open the network dataset.
			ESRI.ArcGIS.Geodatabase.IDataset dataset = datasetContainer3.get_DatasetByName(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTNetworkDataset, NETWORK_DATASET);
			INetworkDataset networkDataset = dataset as INetworkDataset;

			// Create the Route NALayer
			INALayer naLayer = CreateRouteAnalysisLayer("Route", networkDataset);
			INAContext naContext = naLayer.Context;
			INAClass stopsNAClass = naContext.NAClasses.get_ItemByName("Stops") as INAClass;
			IFeatureClass routesFC = naContext.NAClasses.get_ItemByName("Routes") as IFeatureClass;

			// Load the Stops
			INAClassFieldMap naClassFieldMap = new NAClassFieldMapClass();
			naClassFieldMap.set_MappedField("Name", INPUT_NAME_FIELD);

			INAClassLoader naLoader = new NAClassLoaderClass();
			naLoader.Locator = naContext.Locator;
			naLoader.NAClass = stopsNAClass;
			naLoader.FieldMap = naClassFieldMap;

			// Avoid loading network locations onto non-traversable portions of elements
			INALocator3 locator = naContext.Locator as INALocator3;
			locator.ExcludeRestrictedElements = true;
			locator.CacheRestrictedElements(naContext);

			int rowsInCursor = 0;
			int rowsLocated = 0;
			naLoader.Load(inputStopsFClass.Search(new QueryFilterClass(), false) as ICursor, new CancelTrackerClass(), ref rowsInCursor, ref rowsLocated);

			//Message all of the network analysis agents that the analysis context has changed
			((INAContextEdit)naContext).ContextChanged();

			//Solve
			INASolver naSolver = naContext.Solver;
			naSolver.Solve(naContext, new GPMessagesClass(), new CancelTrackerClass());

			//Save the layer to disk
			SaveLayerToDisk(naLayer as ILayer, System.Environment.CurrentDirectory + @"\Route.lyr");
		}
Exemplo n.º 13
0
        //LoadNANetworkLocations
        public void LoadNANetworkLocations(string strNAClassName,IFeatureClass pInputFC,double SnapTolerance,ref INAContext m_pNAContext)
        {
            INAClass pNAClass;
            INamedSet pClasses;
            //get The collection of classes associated with the analysis
            pClasses = m_pNAContext.NAClasses;

            /*
            for(int ii=0;ii<pClasses.Count;ii++)
            {
                MessageBox.Show(pClasses.get_Name(ii));

            }
            */

            pNAClass = pClasses.get_ItemByName(strNAClassName) as INAClass;

            //Remove all items added to the class (for example, stops or incidents).
            pNAClass.DeleteAllRows();

            // Create a NAClassLoader and set the snap tolerance (meters unit)
            //NAClassLoader to populate stop locations from a point feature class.

            INAClassLoader pLoader=new NAClassLoaderClass();

            pLoader.Locator = m_pNAContext.Locator;

            if( SnapTolerance > 0)
            {
                pLoader.Locator.SnapTolerance = SnapTolerance;

            }
            pLoader.NAClass = pNAClass;

            //Create field map to automatically map fields from input class to naclass
            INAClassFieldMap pFieldMap=new NAClassFieldMapClass();

            //pFieldMap.CreateMapping pNAClass.ClassDefinition, pInputFC.Fields;

            pFieldMap.CreateMapping(pNAClass.ClassDefinition,pInputFC.Fields);

            pLoader.FieldMap=pFieldMap;

            int rowsIn=0,rowsLocated=0;

            pLoader.Load(pInputFC.Search(null,true) as ICursor,null,ref rowsIn,ref rowsLocated);
        }