ArcEngine的拓扑分析之ITopologicalOperator

转载自:http://blog.csdn.net/anlidengshiwei/article/details/40377437


先来看看ITopologicalOperator的成员:截图来自帮助文档:


简要介绍下各个成员的汉语翻译:

1、Boundary,边界,获取一个Geometry的边界;

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopologBoundary = pGeo as ITopologicalOperator;  
  2. IGeometry pGeometry = pTopologBoundary.Boundary;  

(1)多边形Polygon的边界获取的是Polyline

(2)Polyline获得的是IPiontColletion点集;(3)点没有边界


2、Buffer,缓冲区,可以为点、线、面做缓冲区,参数为缓冲区范围的大小,大于0向外做缓冲区,小于0向内做缓冲区;

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopologBoundary = pGeo as ITopologicalOperator;  
  2. Geometry pGeometry = pTopologBoundary.Buffer(2);  



3、Clip,叠加裁剪,从源图层中裁剪掉分割图层后的图形;参数类型为IEnvelope类型

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  2. pTopologBoundary.Clip(pClipGeometry.Envelope as IEnvelope);  



4、Cut,分割,将一个Geometry分割为两部分。

用法:

[csharp] view
plain
 copy

 print?

  1. IGeometry pSourceGeometry = null, pClipGeometry = null;  
  2. IGeometry pLeftGeo,pRightGo;  
  3. IPolyline pPolyline=null;  
  4. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  5. pTopologBoundary.Cut(pPolyline, out pLeftGeo, out pRightGo);  


5、Difference,区别,保留下源图层与操作图层中不同的部分。

用法:

[csharp] view
plain
 copy

 print?

  1. IGeometry pSourceGeometry = null, pDifGeometry = null;  
  2. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  3. IGeometry pResultGeo= pTopologBoundary.Difference(pDifGeometry);  


6、Intersect,相交,求两个图层相交,返回IGeometry对象

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopological = (pSubFeature.Shape) as ITopologicalOperator;  
  2. IGeometry pGeoIntersect=pTopological.Intersect(pFeature.Shape, esriGeometryDimension.esriGeometry2Dimension);  


7、IsSimple,是否拓扑闭合

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  2. bool bIsSimple = pTopologBoundary.IsSimple;  

8、Simplify,使一个Geometry拓扑闭合;

用法:

[csharp] view
plain
 copy

 print?

  1. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  2. pTopologBoundary.Simplify();  
[csharp] view
plain
 copy

 print?

  1. 9、Union,使Geometry组合起来  
[csharp] view
plain
 copy

 print?

  1. 用法:  
[csharp] view
plain
 copy

 print?

  1. <pre name=“code” class=“csharp”>IGeometry pSourceGeometry = null, pUnionGeometry = null;  
  2. ITopologicalOperator pTopologBoundary = pSourceGeometry as ITopologicalOperator;  
  3. IGeometry pUnionGeo=pTopologBoundary.Union(pUnionGeometry);  

转载自:https://blog.csdn.net/knqiufan/article/details/78019404

You may also like...