Engine中如何修改拓扑规则检查出来的错误要素?

Engine中如何修改拓扑规则检查出来的错误要素?
已邀请:

刘峥 - ArcGIS多面手

赞同来自:

【解决办法】:
错误要素不能直接编辑,需要先将错误要素添加到RuleException才能进行编辑,如: 


IFeatureClass pFeatureClass = featureWorkspace.OpenFeatureClass(fc); 
IWorkspaceEdit wkspEdit = featureWorkspace as IWorkspaceEdit; 
wkspEdit.StartEditing(false); 
wkspEdit.StartEditOperation(); 

//将错误要素添加进RuleException
topologyRuleContainer.PromoteToRuleException(topologyErrorFeature); 

IFeature pFeature = pFeatureClass.GetFeature(topologyErrorFeature.OriginOID);
IGeometry feaGeo = pFeature.Shape;
ITopologicalOperator5 topo = feaGeo as ITopologicalOperator5;
topo.IsKnownSimple_2 = false;
bool isknowsimple = topo.IsKnownSimple;
topo.Simplify();
pFeature.Shape = topo as IGeometry;
pFeature.Store();
wkspEdit.StopEditOperation();
wkspEdit.StopEditing(true);

topologyRuleContainer.DemoteFromRuleException(topologyErrorFeature);

要回复问题请先登录注册