ArcGIS中的几何对象 您所在的位置:网站首页 gis处理的对象是什么 ArcGIS中的几何对象

ArcGIS中的几何对象

2024-07-12 17:49| 来源: 网络整理| 查看: 265

Polyline 对象是由一个或多个相连或者不相连的path对象的有序集合,通常用来代表线状地物如道路,河流,管线等。

Polyline 是有序 Path 组成的集合,可以拥有M、Z和ID属性值。

在这个模型中,我们看到某些几何对象可以组合产生新的几何形体,如 Polyline 由 Path 构成,Path 又可以由 Segement 组成,但是这并不意味着用户必须按照这种层次去构造Polyline,实际上 Point 集合直接构成 Polyline,组成 Polyline 的这些路径既可以是连续的,也可以是不连续的.

一个 Polyline 对象必须满足以下准则: 1. 组成 Polyline 对象的所有 Path 对象必须是有效的。 2. 组成 Polyline 对象的所有 Path 对象不能重合,相交或自相交。 3. 组成 Polyline 对象的多个 Path 对象可以连接与某一点,也可以分离。 4. Path 对象的长度不能为0。

Polyline 对象的重要接口:

IPolyline Polyline 类的主要接口, IPolyline 的 Reshape 方法可以使用一个 Path 对象为一个 Polyline 对象整形,IPolyline 的 SimplifyNetwork 方法用于简化网络。

IPointCollection 该接口包含了所有的节点信息。

IGeometryCollection 该接口可以获取 Polyline 的Paths。 Polyline 对象可以使用 IGeometryCollection 接口添加 Path 对象的方法来创建。

ISegmentCollection 该接口可以获取 Polyline 的 Segments。

下面代码片段演示了一个Polyline的构成:

private object pMissing = Type.Missing; public IGeometry GetPolylineGeometry() { const double PathCount = 3; const double PathVertexCount = 3; IGeometryCollection pGeometryCollection = new PolylineClass(); for (int i = 0; i < PathCount; i++) { IPointCollection pPointCollection = new PathClass(); for (int j = 0; j < PathVertexCount; j++) { pPointCollection.AddPoint(GetPoint(), ref pMissing, ref pMissing); } pGeometryCollection.AddGeometry(pPointCollection as IGeometry, ref pMissing, ref pMissing); } return pGeometryCollection as IGeometry; } private IPoint GetPoint() { const double Min = -10; const double Max = 10; Random random = new Random(); double x = Min + (Max - Min) * random.NextDouble(); double y = Min + (Max - Min) * random.NextDouble(); return ConstructPoint(x, y); }



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有