把拓扑规则翻译成中文的函数:
- private string PRV_Translate(string IN_RuleName)
- {
- switch (IN_RuleName)
- {
- case "esriTRTAreaNoGaps" :
- return "面要素之间无空隙";
- case "esriTRTAreaNoOverlap":
- return "面要素间无重叠";
- case "esriTRTAreaCoveredByAreaClass":
- return "第二个图层面要素必须被第一个图层任一面要素覆盖";
- case "esriTRTAreaContainOnePoint":
- return "面要素必须只包含一个点要素";
- case "esriTRTAreaAreaCoverEachOther":
- return "两图层面要素必须互相覆盖";
- case "esriTRTAreaCoveredByArea":
- return "第一个图层面要素必须被第一个图层任一面要素包含";
- case "esriTRTAreaNoOverlapArea":
- return "图层间面要素不能相互覆盖";
- case "esriTRTLineCoveredByAreaBoundary":
- return "线要素必须跟面图层边界的一部分或全部重叠";
- case "esriTRTPointCoveredByAreaBoundary":
- return "点要素必须落在面要素边界上";
- case "esriTRTPointProperlyInsideArea":
- return "点要素必须落在面要素内";
- case "esriTRTLineNoOverlap":
- return "线要素间不能有相互重叠部分";
- case "esriTRTLineNoIntersection":
- return "线要素之间不能相交";
- case "esriTRTLineNoDangles":
- return "线要素不允许有悬挂点";
- case "esriTRTLineNoPseudos":
- return "线要素不允许有假节点";
- case "esriTRTLineCoveredByLineClass":
- return "第一个图层线要素应被第二个线图层线要素覆盖";
- case "esriTRTLineNoOverlapLine":
- return "第一个图层线要素不被第二个线图层线要素覆盖";
- case "esriTRTPointCoveredByLine":
- return "点要素应被线要素覆盖";
- case "esriTRTPointCoveredByLineEndpoint":
- return "点要素应在线要素的端点上";
- case "esriTRTAreaBoundaryCoveredByLine":
- return "面要素边界必须被线要素覆盖";
- case "esriTRTAreaBoundaryCoveredByAreaBoundary":
- return "面要素的边界必须被另一面要素边界覆盖";
- case "esriTRTLineNoSelfOverlap":
- return "线要素不能自重叠";
- case "esriTRTLineNoSelfIntersect":
- return "线要素不能自相交";
- case "esriTRTLineNoIntersectOrInteriorTouch":
- return "线要素间不能重叠和相交";
- case "esriTRTLineEndpointCoveredByPoint":
- return "线要素端点必须被点要素覆盖";
- case "esriTRTAreaContainPoint":
- return "面要素内必须包含至少一个点要素";
- case "esriTRTLineNoMultipart":
- return "线不能是多段";
- case "esriTRTPointDisjoint":
- return "点要素之间不相交";
- case "esriTRTLineNoIntersectLine":
- return "线要素必须不相交";
- case "esriTRTLineNoIntersectOrInteriorTouchLine":
- return "线必须不相交或内部接触";
- default:
- return "其他规则";
- }
- }
从中文翻译到拓扑规则的函数:
- //根据错误的中文描述转换成esri拓扑枚举
- private esriTopologyRuleType PRV_ConvertTopologyRuleType(TopoErroType IN_TopoRuleType)
- {
- esriTopologyRuleType Temp_TopoRuleType;
- switch (IN_TopoRuleType)
- {
- case TopoErroType.面要素之间无空隙:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoGaps;
- break;
- case TopoErroType.任何规则:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAny;
- break;
- case TopoErroType.要素大于最小容差:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTFeatureLargerThanClusterTolerance;
- break;
- case TopoErroType.面要素间无重叠:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoOverlap;
- break;
- case TopoErroType.第二个图层面要素必须被第一个图层任一面要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaCoveredByAreaClass;
- break;
- case TopoErroType.面要素必须只包含一个点要素:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaContainOnePoint;
- break;
- case TopoErroType.两图层面要素必须互相覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaAreaCoverEachOther;
- break;
- case TopoErroType.第一个图层面要素必须被第一个图层任一面要素包含:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaCoveredByArea;
- break;
- case TopoErroType.图层间面要素不能相互覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaNoOverlapArea;
- break;
- case TopoErroType.线要素必须跟面图层边界的一部分或全部重叠:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineCoveredByAreaBoundary;
- break;
- case TopoErroType.点要素必须落在面要素边界上:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByAreaBoundary;
- break;
- case TopoErroType.点要素必须落在面要素内:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointProperlyInsideArea;
- break;
- case TopoErroType.线要素间不能有相互重叠部分:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoOverlap;
- break;
- case TopoErroType.线要素之间不能相交:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersection;
- break;
- case TopoErroType.线要素不允许有悬挂点:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoDangles;
- break;
- case TopoErroType.线要素不允许有假节点:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoPseudos;
- break;
- case TopoErroType.第一个图层线要素应被第二个线图层线要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineCoveredByLineClass;
- break;
- case TopoErroType.第一个图层线要素不被第二个线图层线要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoOverlapLine;
- break;
- case TopoErroType.点要素应被线要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByLine;
- break;
- case TopoErroType.点要素应在线要素的端点上:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointCoveredByLineEndpoint;
- break;
- case TopoErroType.面要素边界必须被线要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaBoundaryCoveredByLine;
- break;
- case TopoErroType.面要素的边界必须被另一面要素边界覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaBoundaryCoveredByAreaBoundary;
- break;
- case TopoErroType.线要素不能自重叠:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoSelfOverlap;
- break;
- case TopoErroType.线要素不能自相交:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoSelfIntersect;
- break;
- case TopoErroType.线要素间不能重叠和相交:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectOrInteriorTouch;
- break;
- case TopoErroType.线要素端点必须被点要素覆盖:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineEndpointCoveredByPoint;
- break;
- case TopoErroType.面要素内必须包含至少一个点要素:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAreaContainPoint;
- break;
- case TopoErroType.线不能是多段:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoMultipart;
- break;
- case TopoErroType.点要素之间不相交:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTPointDisjoint;
- break;
- case TopoErroType.线要素必须不相交:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectLine;
- break;
- case TopoErroType.线必须不相交或内部接触:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTLineNoIntersectOrInteriorTouchLine;
- break;
- default:
- Temp_TopoRuleType = esriTopologyRuleType.esriTRTAny;//将此规则赋予拓扑会直接报错
- break;
- }
- return Temp_TopoRuleType;
- }
- public enum TopoErroType
- {
- 任何规则=-1,
- 要素大于最小容差 = 0,
- 面要素之间无空隙 = 1,
- 面要素间无重叠 = 3,
- 第二个图层面要素必须被第一个图层任一面要素覆盖 = 4,
- 两图层面要素必须互相覆盖 = 5,
- 第一个图层面要素必须被第一个图层任一面要素包含 = 7,
- 图层间面要素不能相互覆盖 = 8,
- 线要素必须跟面图层边界的一部分或全部重叠 = 10,
- 线要素必须在面内=11,
- 点要素必须落在面要素边界上 = 13,
- 点要素必须落在面要素内 = 15,
- 面要素必须只包含一个点要素=16,
- 线要素间不能有相互重叠部分 = 19,
- 线要素之间不能相交 = 20,
- 线要素不允许有悬挂点 = 21,
- 线要素不允许有假节点 = 22,
- 第一个图层线要素应被第二个线图层线要素覆盖 = 26,
- 第一个图层线要素不被第二个线图层线要素覆盖 = 28,
- 点要素应被线要素覆盖 = 29,
- 点要素应在线要素的端点上 = 31,
- 点要素之间不相交=34,
- 点要素重合点要素=35,
- 面要素边界必须被线要素覆盖 = 37,
- 面要素的边界必须被另一面要素边界覆盖 = 38,
- 线要素不能自重叠 = 39,
- 线要素不能自相交 = 40,
- 线要素间不能重叠和相交 = 41,
- 线要素端点必须被点要素覆盖 = 42,
- 面要素内必须包含至少一个点要素 = 43,
- 线不能是多段 = 44,
- 线要素必须不相交=45,
- 线必须不相交或内部接触=46
- };