我是靠谱客的博主 悲凉黑夜,最近开发中收集的这篇文章主要介绍ArcGIS中的几何对象—— Polyline,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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的构成:

复制代码
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
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); }


最后

以上就是悲凉黑夜为你收集整理的ArcGIS中的几何对象—— Polyline的全部内容,希望文章能够帮你解决ArcGIS中的几何对象—— Polyline所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部