ArcEngine的拓扑检查类

  1.         //主要有添加构建拓扑,拓扑中添加要素,添加规则,输出拓扑错误的功能。  
  2.         TopologyChecker topocheck = new TopologyChecker(mainlogyDataSet);//传入要处理的要素数据集  
  3.         topocheck.PUB_TopoBuild("testTopo2");//构建拓扑的名字  
  4.         topocheck.PUB_AddFeatureClass(null);//将该要素中全部要素都加入拓扑  
  5.         //添加规则  
  6.         topocheck.PUB_AddRuleToTopology(TopologyChecker.TopoErroType.点要素之间不相交, (topocheck.PUB_GetAllFeatureClass())[2], (topocheck.PUB_GetAllFeatureClass())[0]);  
  7.         //获取生成的拓扑图层并添加  
  8.         axMapControl1.Map.AddLayer(topocheck.PUB_GetTopoLayer());  
  9.         axMapControl1.ActiveView.Refresh();  

类代码:注意修改命名空间


[csharp]  view plain  copy
 
  1. using System;  
  2. using System.Collections;  
  3. using System.Collections.Generic;  
  4. using System.Linq;  
  5. using System.Text;  
  6. using ESRI.ArcGIS.Geodatabase;  
  7. using ESRI.ArcGIS.DataSourcesGDB;  
  8. using ESRI.ArcGIS.Geometry;  
  9. using ESRI.ArcGIS.Carto;  
  10. using ESRI.ArcGIS.Geoprocessor;  
  11. using ESRI.ArcGIS.DataManagementTools;  
  12. using System.Windows.Forms;  
  13. using System.Runtime.InteropServices;  
  14.   
  15. namespace EngineWindowsApplication1  
  16. {  
  17.     class TopologyChecker//功能:构建拓扑,拓扑检测  
  18.     {  
  19.   
  20.         Geoprocessor GP_Tool = new Geoprocessor();//GP运行工具  
  21.         ITopology Topology;//生成的拓扑  
  22.         IFeatureDataset FeatureDataset_Main;//拓扑所属的要素数据集  
  23.         List LI_FeatureClass = new List();//要素数据集所包含的所有要素类  
  24.         List<string> LI_AllErrorInfo = new List<string>();//记录所有错误信息  
  25.         ITopologyLayer L_TopoLayer;//记录拓扑的图层  
  26.  
  27.         #region 辅助函数  
  28.           
  29.         ///   
  30.         /// 获取拓扑图层  
  31.         ///   
  32.         /// 拓扑图层Ilayer  
  33.         public ILayer PUB_GetTopoLayer()  
  34.         {  
  35.             if (L_TopoLayer == null)  
  36.             {  
  37.                 L_TopoLayer = new TopologyLayerClass();  
  38.                 L_TopoLayer.Topology = Topology;  
  39.             }  
  40.             return L_TopoLayer as ILayer;  
  41.         }  
  42.   
  43.         ///   
  44.         /// 构造拓扑检验类  
  45.         ///   
  46.         /// 输入的要素数据集  
  47.         public TopologyChecker(IFeatureDataset IN_MainlogyDataSet)  
  48.         {  
  49.             FeatureDataset_Main = IN_MainlogyDataSet;  
  50.             if (LI_FeatureClass.Count != 0)  
  51.                 LI_FeatureClass.Clear();  
  52.             PUB_GetAllFeatureClass();//获取数据集中所有包含的要素类  
  53.         }  
  54.   
  55.         ///   
  56.         /// 获取数据集中所有包含的要素类  
  57.         ///   
  58.         /// 返回数据集中所有包含的要素类 List  
  59.         public List PUB_GetAllFeatureClass()  
  60.         {  
  61.             if (LI_FeatureClass.Count == 0)  
  62.             {  
  63.                 IFeatureClassContainer Temp_FeatureClassContainer = (IFeatureClassContainer)FeatureDataset_Main;  
  64.                 IEnumFeatureClass Temp_EnumFeatureClass = Temp_FeatureClassContainer.Classes;  
  65.                 IFeatureClass Temp_FeatureClass = Temp_EnumFeatureClass.Next();  
  66.   
  67.                 while (Temp_FeatureClass != null)  
  68.                 {  
  69.                     LI_FeatureClass.Add(Temp_FeatureClass);  
  70.                     Temp_FeatureClass = Temp_EnumFeatureClass.Next();  
  71.                 }  
  72.                 if (LI_FeatureClass.Count == 0)  
  73.                 {  
  74.                     MessageBox.Show("空数据集!");  
  75.                 }  
  76.             }  
  77.   
  78.             return LI_FeatureClass;  
  79.         }  
  80.         #endregion  
  81.  
  82.         #region 构建拓扑  
  83.   
  84.         ///   
  85.         /// 在数据集中构建拓扑(GP方法)  
  86.         ///   
  87.         /// 要生成拓扑的名称  
  88.         /// 拓扑容差,可选,默认0.001  
  89.         public void PUB_TopoBuildWithGP(string IN_TopoName, double IN_Tolerance = 0.001)  
  90.         {  
  91.             IWorkspace FeatureWorkSpace = FeatureDataset_Main.Workspace;  
  92.             ITopologyWorkspace TopoWorkSpace = FeatureWorkSpace as ITopologyWorkspace;  
  93.             try//若不存在同名拓扑则添加  
  94.             {  
  95.                 Topology = TopoWorkSpace.OpenTopology(IN_TopoName);  
  96.                 MessageBox.Show("已存在该拓扑,无法添加!");  
  97.             }  
  98.             catch  
  99.             {  
  100.                 CreateTopology Topotool = new CreateTopology();//拓扑GP工具  
  101.                 Topotool.in_dataset = FeatureDataset_Main; ;  
  102.                 Topotool.out_name = IN_TopoName;  
  103.                 Topotool.in_cluster_tolerance = IN_Tolerance;  
  104.                 try  
  105.                 {  
  106.                     GP_Tool.Execute(Topotool, null);  
  107.                     Topology = TopoWorkSpace.OpenTopology(IN_TopoName);  
  108.                 }  
  109.                 catch (COMException comExc)  
  110.                 {  
  111.                     MessageBox.Show(String.Format("拓扑创建出错: {0} 描述: {1}", comExc.ErrorCode, comExc.Message));  
  112.                 }  
  113.             }  
  114.         }  
  115.   
  116.   
  117.         ///   
  118.         /// 在数据集中构建拓扑  
  119.         ///   
  120.         /// 要生成拓扑的名称  
  121.         /// 拓扑容差,可选,默认0.001  
  122.         public void PUB_TopoBuild(string IN_TopoName, double IN_Tolerance = 0.001)  
  123.         {  
  124.             ITopologyContainer topologyContainer = (ITopologyContainer)FeatureDataset_Main;  
  125.             try//若不存在同名拓扑则添加  
  126.             {  
  127.                 Topology = topologyContainer.get_TopologyByName(IN_TopoName);  
  128.                 MessageBox.Show("已存在该拓扑,无法添加!");  
  129.             }  
  130.             catch  
  131.             {  
  132.                 try  
  133.                 {  
  134.                     Topology = topologyContainer.CreateTopology(IN_TopoName, IN_Tolerance, -1, "");  
  135.                 }  
  136.                 catch (COMException comExc)  
  137.                 {  
  138.                     MessageBox.Show(String.Format("拓扑创建出错: {0} 描述: {1}", comExc.ErrorCode, comExc.Message));  
  139.                 }  
  140.             }  
  141.         }  
  142.  
  143.         #endregion  
  144.  
  145.         #region 添加要素类  
  146.   
  147.         ///   
  148.         /// 添加特定要素类到拓扑中(GP方法)  
  149.         ///   
  150.         /// 要添加的要素类的集合。输入null为该数据集下所有要素类  
  151.         /// XY等级,默认为1。可选。  
  152.         /// Z等级,默认为1。可选。  
  153.         public void PUB_AddFeatureClassWithGP(List IN_TopologyClass, int IN_XYRank = 1, int IN_ZRank = 1)  
  154.         {  
  155.             if (Topology != null)  
  156.             {  
  157.                 AddFeatureClassToTopology Temp_AddClassToTopo = new AddFeatureClassToTopology();  
  158.                 Temp_AddClassToTopo.in_topology = Topology;  
  159.                 Temp_AddClassToTopo.xy_rank = IN_XYRank;  
  160.                 Temp_AddClassToTopo.z_rank = IN_ZRank;  
  161.                 if (IN_TopologyClass == null)  
  162.                 {  
  163.                     IN_TopologyClass = LI_FeatureClass;  
  164.                 }  
  165.                 foreach (IFeatureClass EachFeatureCLS in IN_TopologyClass)  
  166.                 {  
  167.                     if (LI_FeatureClass.Contains(EachFeatureCLS))  
  168.                     {  
  169.                         Temp_AddClassToTopo.in_featureclass = EachFeatureCLS;  
  170.                         try  
  171.                         {  
  172.                             GP_Tool.Execute(Temp_AddClassToTopo, null);  
  173.                         }  
  174.                         catch (COMException comExc)  
  175.                         {  
  176.                             MessageBox.Show(String.Format(((FeatureClass)EachFeatureCLS).Name + ":添加失败。 描述: {0}", comExc.Message));  
  177.                         }  
  178.                     }  
  179.                     else  
  180.                     {  
  181.                         MessageBox.Show("该要素类不属于目标要素集,无法添加!");  
  182.                     }  
  183.                 }  
  184.             }  
  185.             else  
  186.             {  
  187.                 MessageBox.Show("请先构建拓扑");  
  188.             }  
  189.         }  
  190.   
  191.   
  192.         ///   
  193.         /// 添加特定要素类到拓扑中  
  194.         ///   
  195.         /// 要添加的要素类的集合。输入null为该数据集下所有要素类  
  196.         /// XY等级,默认为1。可选。  
  197.         /// Z等级,默认为1。可选。  
  198.         /// 权重,默认为5。可选。  
  199.         public void PUB_AddFeatureClass(List IN_TopologyClass, int IN_XYRank = 1, int IN_ZRank = 1, double IN_Weight = 5)  
  200.         {  
  201.             if (Topology != null)  
  202.             {  
  203.                 if (IN_TopologyClass == null)  
  204.                 {  
  205.                     IN_TopologyClass = LI_FeatureClass;  
  206.                 }  
  207.                 foreach (IFeatureClass EachFeatureCLS in IN_TopologyClass)//逐项添加所选的要素类  
  208.                 {  
  209.                     if (LI_FeatureClass.Contains(EachFeatureCLS))//只有相同要素数据集中的要素可以被添加  
  210.                     {  
  211.                         try  
  212.                         {  
  213.                             Topology.AddClass(EachFeatureCLS as IClass, IN_Weight, IN_XYRank, IN_ZRank, false);  
  214.                         }  
  215.                         catch (COMException comExc)  
  216.                         {  
  217.                             MessageBox.Show(String.Format(((FeatureClass)EachFeatureCLS).Name + ":添加失败。 描述: {0}", comExc.Message));  
  218.                         }  
  219.                     }  
  220.                     else  
  221.                     {  
  222.                         MessageBox.Show("该要素类不属于目标要素集,无法添加!");  
  223.                     }  
  224.                 }  
  225.             }  
  226.             else  
  227.             {  
  228.                 MessageBox.Show("请先构建拓扑");  
  229.             }  
  230.         }  
  231.         #endregion  
  232.  
  233.         #region 添加规则并检验  
  234.         //GP法拓扑验证  
  235.         private void PRV_ValidateTopologyWithGP()  
  236.         {  
  237.             try  
  238.             {  
  239.                 ValidateTopology Temp_Validate = new ValidateTopology(Topology);  
  240.                 GP_Tool.Execute(Temp_Validate, null);  
  241.             }  
  242.             catch  
  243.             {  
  244.                 MessageBox.Show("无法完成检测!");  
  245.             }  
  246.         }  
  247.   
  248.         ///   
  249.         /// 单要素规则  
  250.         ///   
  251.         /// 要添加的规则  
  252.         /// 添加规则的要素类  
  253.         public void PUB_AddRuleToTopology(TopoErroType IN_RuleType, IFeatureClass IN_FeatureClass)  
  254.         {  
  255.             if (Topology != null)  
  256.             {  
  257.                 ITopologyRule Temp_TopologyRule = new TopologyRuleClass();  
  258.                 //设定参数  
  259.                 Temp_TopologyRule.TopologyRuleType = PRV_ConvertTopologyRuleType(IN_RuleType);  
  260.                 Temp_TopologyRule.Name = IN_RuleType.ToString();  
  261.                 Temp_TopologyRule.OriginClassID = IN_FeatureClass.FeatureClassID;  
  262.                 Temp_TopologyRule.AllOriginSubtypes = true;  
  263.                 PRV_AddRuleTool(Temp_TopologyRule);  
  264.             }  
  265.             else  
  266.             {  
  267.                 MessageBox.Show("请先构建拓扑");  
  268.             }  
  269.         }  
  270.   
  271.         ///   
  272.         /// 双要素规则  
  273.         ///   
  274.         /// 要添加的双要素规则  
  275.         /// 第一个要素  
  276.         /// 第二个要素  
  277.         public void PUB_AddRuleToTopology(TopoErroType IN_RuleType, IFeatureClass IN_FeatureClassA, IFeatureClass IN_FeatureClassB)  
  278.         {  
  279.             if (Topology != null)  
  280.             {  
  281.                 ITopologyRule Temp_TopologyRule = new TopologyRuleClass();  
  282.                 //设定参数  
  283.                 Temp_TopologyRule.TopologyRuleType = PRV_ConvertTopologyRuleType(IN_RuleType);  
  284.                 Temp_TopologyRule.Name = IN_RuleType.ToString();  
  285.                 Temp_TopologyRule.OriginClassID = IN_FeatureClassA.FeatureClassID;  
  286.                 Temp_TopologyRule.DestinationClassID = IN_FeatureClassB.FeatureClassID;  
  287.                 Temp_TopologyRule.AllOriginSubtypes = true;  
  288.                 Temp_TopologyRule.AllDestinationSubtypes = true;  
  289.                 PRV_AddRuleTool(Temp_TopologyRule);  
  290.             }  
  291.             else  
  292.             {  
  293.                 MessageBox.Show("请先构建拓扑");  
  294.             }  
  295.       
  296.         }  
  297.   
  298.         //规则添加工具  
  299.         private void PRV_AddRuleTool(ITopologyRule IN_TopologyRule)  
  300.         {  
  301.              ITopologyRuleContainer Temp_TopologyRuleContainer = (ITopologyRuleContainer)Topology;//构建容器  
  302.                 try  
  303.                 {  
  304.                     Temp_TopologyRuleContainer.get_CanAddRule(IN_TopologyRule);//不能添加的话直接报错  
  305.                     try  
  306.                     {  
  307.                         Temp_TopologyRuleContainer.DeleteRule(IN_TopologyRule);//删除已存在的规则后再添加  
  308.                         Temp_TopologyRuleContainer.AddRule(IN_TopologyRule);//规则存在的话直接报错  
  309.                     }  
  310.                     catch  
  311.                     {  
  312.                         Temp_TopologyRuleContainer.AddRule(IN_TopologyRule);  
  313.                     }  
  314.                 }  
  315.                 catch  
  316.                 {  
  317.                     MessageBox.Show("不支持添加");  
  318.                 }  
  319.                 PRV_ValidateTopologyWithGP();//添加完成后自动检验  
  320.                 PUB_GetTopoLayer();//存储创建的拓扑图层  
  321.                 PRV_GetError(IN_TopologyRule);//输出错误  
  322.         }  
  323.       
  324.         //获取错误信息  
  325.         private void PRV_GetError(ITopologyRule IN_TopologyRule)  
  326.         {  
  327.             if (Topology != null)  
  328.             {  
  329.                 IEnvelope Temp_Envolope = (this.Topology as IGeoDataset).Extent;  
  330.                 IErrorFeatureContainer Temp_ErrorContainer = Topology as IErrorFeatureContainer;  
  331.                 //获取所有信息  
  332.                 IEnumTopologyErrorFeature Temp_EnumErrorFeature = Temp_ErrorContainer.get_ErrorFeatures(((IGeoDataset)FeatureDataset_Main).SpatialReference, IN_TopologyRule, Temp_Envolope, truetrue);  
  333.                 ITopologyErrorFeature Temp_ErrorFeature = Temp_EnumErrorFeature.Next();  
  334.                 while (Temp_ErrorFeature != null)  
  335.                 {  
  336.                     IFeature Temp_Feature = Temp_ErrorFeature as IFeature;  
  337.                     string Temp_ErrorInfo;  
  338.                     if (Temp_ErrorFeature.DestinationClassID != 0)//检测是否是双要素规则  
  339.                     {  
  340.                         Temp_ErrorInfo = Temp_ErrorFeature.OriginOID + "," + Temp_ErrorFeature.DestinationOID;  
  341.                     }  
  342.                     else  
  343.                         Temp_ErrorInfo = Temp_ErrorFeature.OriginOID.ToString();  
  344.                     LI_AllErrorInfo.Add(Temp_ErrorInfo);//将错误信息加入List  
  345.                     MessageBox.Show("错误:" + PRV_RecorverTopologyRuleType((int)(Temp_ErrorFeature.TopologyRuleType)) + "\r\n错误ID:" + Temp_ErrorInfo);  
  346.                     Temp_ErrorFeature = Temp_EnumErrorFeature.Next();  
  347.                 }  
  348.             }  
  349.             else  
  350.             {  
  351.                 MessageBox.Show("请先构建拓扑");  
  352.             }  
  353.         }  
  354.   
  355.         ///   
  356.         /// 提取所有拓扑错误信息  
  357.         ///   
  358.         /// 错误信息集合  
  359.         public List<string> PUB_GetErrorInfo()  
  360.         {  
  361.             return LI_AllErrorInfo;  
  362.         }  
  363.  
  364.         #region 规则翻译  
  365.   
  366.         //根据错误的中文描述转换成esri拓扑枚举  
  367.         private esriTopologyRuleType PRV_ConvertTopologyRuleType(TopoErroType IN_TopoRuleType)  
  368.         {  
  369.             esriTopologyRuleType Temp_TopoRuleType;  
  370.             switch (IN_TopoRuleType)  
  371.             {  
  372.                 case TopoErroType.面要素之间无空隙:  
  373.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoGaps;  
  374.                     break;  
  375.                 case TopoErroType.任何规则:  
  376.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAny;  
  377.                     break;  
  378.                 case TopoErroType.要素大于最小容差:  
  379.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTFeatureLargerThanClusterTolerance;  
  380.                     break;  
  381.                 case TopoErroType.面要素间无重叠:  
  382.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoOverlap;  
  383.                     break;  
  384.                 case TopoErroType.第二个图层面要素必须被第一个图层任一面要素覆盖:  
  385.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaCoveredByAreaClass;  
  386.                     break;  
  387.                 case TopoErroType.面要素必须只包含一个点要素:  
  388.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaContainOnePoint;  
  389.                     break;  
  390.                 case TopoErroType.两图层面要素必须互相覆盖:  
  391.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaAreaCoverEachOther;  
  392.                     break;  
  393.                 case TopoErroType.第一个图层面要素必须被第一个图层任一面要素包含:  
  394.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaCoveredByArea;  
  395.                     break;  
  396.                 case TopoErroType.图层间面要素不能相互覆盖:  
  397.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoOverlapArea;  
  398.                     break;  
  399.                 case TopoErroType.线要素必须跟面图层边界的一部分或全部重叠:  
  400.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineCoveredByAreaBoundary;  
  401.                     break;  
  402.                 case TopoErroType.点要素必须落在面要素边界上:  
  403.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByAreaBoundary;  
  404.                     break;  
  405.                 case TopoErroType.点要素必须落在面要素内:  
  406.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointProperlyInsideArea;  
  407.                     break;  
  408.                 case TopoErroType.线要素间不能有相互重叠部分:  
  409.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoOverlap;  
  410.                     break;  
  411.                 case TopoErroType.线要素之间不能相交:  
  412.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersection;  
  413.                     break;  
  414.                 case TopoErroType.线要素不允许有悬挂点:  
  415.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoDangles;  
  416.                     break;  
  417.                 case TopoErroType.线要素不允许有假节点:  
  418.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoPseudos;  
  419.                     break;  
  420.                 case TopoErroType.第一个图层线要素应被第二个线图层线要素覆盖:  
  421.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineCoveredByLineClass;  
  422.                     break;  
  423.                 case TopoErroType.第一个图层线要素不被第二个线图层线要素覆盖:  
  424.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoOverlapLine;  
  425.                     break;  
  426.                 case TopoErroType.点要素应被线要素覆盖:  
  427.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByLine;  
  428.                     break;  
  429.                 case TopoErroType.点要素应在线要素的端点上:  
  430.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByLineEndpoint;  
  431.                     break;  
  432.                 case TopoErroType.面要素边界必须被线要素覆盖:  
  433.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaBoundaryCoveredByLine;  
  434.                     break;  
  435.                 case TopoErroType.面要素的边界必须被另一面要素边界覆盖:  
  436.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaBoundaryCoveredByAreaBoundary;  
  437.                     break;  
  438.                 case TopoErroType.线要素不能自重叠:  
  439.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoSelfOverlap;  
  440.                     break;  
  441.                 case TopoErroType.线要素不能自相交:  
  442.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoSelfIntersect;  
  443.                     break;  
  444.                 case TopoErroType.线要素间不能重叠和相交:  
  445.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectOrInteriorTouch;  
  446.                     break;  
  447.                 case TopoErroType.线要素端点必须被点要素覆盖:  
  448.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineEndpointCoveredByPoint;  
  449.                     break;  
  450.                 case TopoErroType.面要素内必须包含至少一个点要素:  
  451.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaContainPoint;  
  452.                     break;  
  453.                 case TopoErroType.线不能是多段:  
  454.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoMultipart;  
  455.                     break;  
  456.                 case TopoErroType.点要素之间不相交:  
  457.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointDisjoint;  
  458.                     break;  
  459.                 case TopoErroType.线要素必须不相交:  
  460.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectLine;  
  461.                     break;  
  462.                 case TopoErroType.线必须不相交或内部接触:  
  463.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectOrInteriorTouchLine;  
  464.                     break;  
  465.                 default:  
  466.                     Temp_TopoRuleType = esriTopologyRuleType.esriTRTAny;//将此规则赋予拓扑会直接报错  
  467.                     break;  
  468.             }  
  469.             return Temp_TopoRuleType;  
  470.         }  
  471.   
  472.         public enum TopoErroType  
  473.         {  
  474.             任何规则=-1,  
  475.             要素大于最小容差 = 0,  
  476.             面要素之间无空隙 = 1,  
  477.             面要素间无重叠 = 3,  
  478.             第二个图层面要素必须被第一个图层任一面要素覆盖 = 4,  
  479.             两图层面要素必须互相覆盖 = 5,  
  480.             第一个图层面要素必须被第一个图层任一面要素包含 = 7,  
  481.             图层间面要素不能相互覆盖 = 8,  
  482.             线要素必须跟面图层边界的一部分或全部重叠 = 10,  
  483.             线要素必须在面内=11,  
  484.             点要素必须落在面要素边界上 = 13,  
  485.             点要素必须落在面要素内 = 15,  
  486.             面要素必须只包含一个点要素=16,  
  487.             线要素间不能有相互重叠部分 = 19,  
  488.             线要素之间不能相交 = 20,  
  489.             线要素不允许有悬挂点 = 21,  
  490.             线要素不允许有假节点 = 22,  
  491.             第一个图层线要素应被第二个线图层线要素覆盖 = 26,  
  492.             第一个图层线要素不被第二个线图层线要素覆盖 = 28,  
  493.             点要素应被线要素覆盖 = 29,  
  494.             点要素应在线要素的端点上 = 31,  
  495.             点要素之间不相交=34,  
  496.             点要素重合点要素=35,  
  497.             面要素边界必须被线要素覆盖 = 37,  
  498.             面要素的边界必须被另一面要素边界覆盖 = 38,  
  499.             线要素不能自重叠 = 39,  
  500.             线要素不能自相交 = 40,  
  501.             线要素间不能重叠和相交 = 41,  
  502.             线要素端点必须被点要素覆盖 = 42,  
  503.             面要素内必须包含至少一个点要素 = 43,  
  504.             线不能是多段 = 44,  
  505.             线要素必须不相交=45,  
  506.             线必须不相交或内部接触=46  
  507.         };  
  508.   
  509.         //根据错误ID获取对应描述  
  510.         private string PRV_RecorverTopologyRuleType(int IN_TopoType)  
  511.         {  
  512.             //根据枚举值获取枚举名  
  513.             string Temp_ErrorDiscripe=Enum.GetName(typeof(TopoErroType), IN_TopoType);  
  514.             if (Temp_ErrorDiscripe == null)  
  515.                 return (IN_TopoType.ToString());//若规则不在列表内则直接返回规则号  
  516.             else  
  517.                 return Temp_ErrorDiscripe;  
  518.         }  
  519.         #endregion  
  520.  
  521.         #endregion  
  522.          
  523.     }  
  524. }  

你可能感兴趣的:(ArcEngine)