VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > temp > C#教程 >
  • Arcgis Runtime for Net创建包含多个线条的Polyline要素

在Arcgis的Polyline图层,有时需要用两个或多个线条表示一个要素,比如存在分支的路径,道路的上下行车道。

在ArcMap中可以通过编辑图层,选中两个线条后,执行Merge命令,那么在Runtime for Net中如何实现呢?

开始找了很长时间是不是也有与Merge功能类似的API提供,后来发现可能没有。需要在创建Geometry时,就设定为两个或多个线条。

将线条的构成点分别存入两个PointCollection,然后用PointCollection的列表创建要素即可。  

复制代码
PointCollection pts1 = new PointCollection(SpatialReferences.Wgs84);
pts1.Add(pt);
pts1.Add(pt1);
pts1.Add(pt2);
PointCollection pts2 = new PointCollection(SpatialReferences.Wgs84);
pts2.Add(pt3);
pts2.Add(pt4);
List<PointCollection> lines = new List<PointCollection>() { pts1,pts2};
Polyline poly = new Polyline(lines);
复制代码

 

 
分类: Arcgis


相关教程