ArcGIS拓扑检查

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

 

 

注:如果有两个要素参与到拓扑,在修复拓扑错误时会优先移动拓扑级别低的要素来满足匹配拓扑规则要求。

参考资料:

https://wenku.baidu.com/view/b446ad5e04a1b0717ed5dd4e.html

http://zhihu.esrichina.com.cn/article/1573

 

拓扑检查官方文档有误导

当两个要素类参与拓扑时,官方有一段代码,将拓扑规则加到拓扑中:

1
topologyRule.AllOriginSubtypes = false;
1
topologyRule.AllDestinationSubtypes = false;<br>对于AllOriginSubtypes、AllDestinationSubtypes的官方解释:

ITopologyRule.AllOriginSubtypes Property

Indicates if all origin subtypes are specified for the topology rule.

ITopologyRule.AllDestinationSubtypes Property

Indicates if all destination subtypes are specified for the topology rule.

默认为false,但是这样是得不到拓扑结果的。

overlap2:overlap2,这里是有问题的,实际就是:“overlap2”。具体原因也没搞清楚。

  地址:

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/d/0001000002nv000000.htm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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.");
    }
}

  

posted @   Youse的二分口粮地  阅读(1027)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· Vue3状态管理终极指南:Pinia保姆级教程
点击右上角即可分享
微信分享提示