ArcEngine面要素转线要素

        /// <summary>
        /// 面转线(GP法)(获取相邻面)需要最高ArcEngine权限
        /// </summary>
        /// <param name="IN_Featureclass">要转换的要素类</param>
        /// <param name="IN_SaveNeighborInfor">是否保存相邻区域信息</param>
        /// <param name="IN_LineName">转换后的要素名</param>
        /// <returns>转换后的要素</returns>
        private IFeatureClass PRV_PolyGonToLine_GP(IFeatureClass IN_Featureclass,bool IN_SaveNeighborInfor,string IN_LineName)
        {
            //要素数据集路径
            string Temp_FeaturedatasetPath;
            //要素数据集
            IFeatureDataset Temp_FeatureDataset = IN_Featureclass.FeatureDataset;
            if (Temp_FeatureDataset == null)
                Temp_FeatureDataset = IN_Featureclass as IFeatureDataset;
            Temp_FeaturedatasetPath = Temp_FeatureDataset.Workspace.PathName + "\\" + Temp_FeatureDataset.Name + "\\";
            //面转线
            Geoprocessor GP_Tool = new Geoprocessor();//GP运行工具
            ESRI.ArcGIS.DataManagementTools.PolygonToLine GP_PolyGonToline = new PolygonToLine();
            GP_PolyGonToline.in_features = Temp_FeaturedatasetPath + IN_Featureclass.AliasName;
            GP_PolyGonToline.neighbor_option = IN_SaveNeighborInfor.ToString().ToLower();
            GP_PolyGonToline.out_feature_class = Temp_FeaturedatasetPath + IN_LineName;
            GP_Tool.Execute(GP_PolyGonToline, null);
            //获取生成的要素类
            IFeatureClass Temp_FeatureClass = (Temp_FeatureDataset.Workspace as IFeatureWorkspace).OpenFeatureClass(IN_LineName);
            return Temp_FeatureClass;
        }

你可能感兴趣的:(arcgis,ArcEngine,ArcgisEngine,ae,gp工具)