ArcGIS拓扑检查
对于拓扑检查中的等级参数一直不理解,经过参考资料才明白过来:

注:如果有两个要素参与到拓扑,在修复拓扑错误时会优先移动拓扑级别低的要素来满足匹配拓扑规则要求。
参考资料:
https://wenku.baidu.com/view/b446ad5e04a1b0717ed5dd4e.html
http://zhihu.esrichina.com.cn/article/1573
拓扑检查官方文档有误导
当两个要素类参与拓扑时,官方有一段代码,将拓扑规则加到拓扑中:
topologyRule.AllOriginSubtypes = false;
topologyRule.AllDestinationSubtypes = false;
对于AllOriginSubtypes、AllDestinationSubtypes的官方解释:
Indicates if all origin subtypes are specified for the topology rule.
Indicates if all destination subtypes are specified for the topology rule.
默认为false,但是这样是得不到拓扑结果的。

overlap2:overlap2,这里是有问题的,实际就是:“overlap2”。具体原因也没搞清楚。
地址:
public void AddRuleToTopology(ITopology topology, esriTopologyRuleType ruleType,
String ruleName, IFeatureClass originClass, int originSubtype, IFeatureClass
destinationClass, int destinationSubtype)
{
// Create a topology rule.
ITopologyRule topologyRule = new TopologyRuleClass();
topologyRule.TopologyRuleType = ruleType;
topologyRule.Name = ruleName;
topologyRule.OriginClassID = originClass.FeatureClassID;
topologyRule.AllOriginSubtypes = false;
topologyRule.OriginSubtype = originSubtype;
topologyRule.DestinationClassID = destinationClass.FeatureClassID;
topologyRule.AllDestinationSubtypes = false;
topologyRule.DestinationSubtype = destinationSubtype;
// Cast the topology to the ITopologyRuleContainer interface and add the rule.
ITopologyRuleContainer topologyRuleContainer = (ITopologyRuleContainer)topology;
if (topologyRuleContainer.get_CanAddRule(topologyRule))
{
topologyRuleContainer.AddRule(topologyRule);
}
else
{
throw new ArgumentException("Could not add specified rule to the topology.");
}
}

浙公网安备 33010602011771号