Geometry是一种基本类。它是一种抽象类。是ArcGIS Engine中使用最为广泛的对象集之一,用户在创建、删除、编辑和进行地理分析的时候,就是处理一个包含几何形体的矢量对象;除了显示要素以外,控件对象选择,要素符号化,标注要素,编辑要素都需要Geometry参与。
在Geometry模型中的几何对象分为两种类型,一类是用来直接构建要素类的称为高级几何对象,一类用来构建高级几何对象的相对低一级的几何对象称为构建几何对象如下表所示。
几何对象名称 | 中文名 | 所属类别 | 构成子几何对象 | 用于创建和编辑的接口 |
Polyline | 多义线 | 高级 | Path | IGeometryCollection,IPointCollection |
Polygon | 多边形 | 高级 | Ring | IGeometryCollection,IPointCollection |
MultiPoint | 点集 | 高级 | Point | IGeometryCollection,IPointCollection |
MultiPatch | 多面体 | 高级 |
TrangleFan,Ring, TrangleStrip,Trangles |
IGeometryCollection,IPointCollection |
Ring | 环 | 低级 | Segment | ISegmentCollection,IPointCollection |
Path | 路径 | 低级 | Segment | ISegmentCollection,IPointCollection |
Segment | 线 | 低级 | Point | IPoint,ILine, ICurve |
TriangleFan | 三角扇 | 低级 | Point | IGeometryCollection,IPointCollection |
TriangleStrip | 三角片 | 低级 | Point | IGeometryCollection,IPointCollection |
Triangles | 三角形 | 低级 | Point | IGeometryCollection,IPointCollection |
Point | 点 | 高级/低级 | 无 | IPoint |
几何对象
1、Point:是一个0维的几何图形,具有X,Y坐标值,以及一些可选的属性:如高程值(Z值),度量值(M值)。
2、MultiPoint:点集对象是一系列无序的点的群集,这些点具有相同的属性信息。例如可以用一个点集来表示整个城市天然气调压站。以下代码片段演示如何构建Multipoint对象。
//定义第一个点
IPoint pPoint1 = new PointClass();
pPoint1.X = 100;
pPoint1.Y = 100;
//定义第二个点
IPoint pPoint2 = new PointClass();
pPoint2.PutCoords(200, 200);
//……构建其他点
IPointCollection pMultipoint = new MultipointClass();
object o = Type.Missing;
//添加第一个点,不需要设置点的顺序,参数设置为Type.Missing
pMultipoint.AddPoint(pPoint1, ref o, ref o);
//添加第二个点,不需要设置点的顺序,参数设置为Type.Missing
pMultipoint.AddPoint(pPoint2, ref o, ref o);
//……添加其他点
来源:CSDN
作者:秋漓
链接:https://blog.csdn.net/qq_33459369/article/details/103654606