Arcgis Runtime for Net建立包含多個線條的Polyline要素

在Arcgis的Polyline圖層,有時須要用兩個或多個線條表示一個要素,好比存在分支的路徑,道路的上下行車道。spa

在ArcMap中能夠經過編輯圖層,選中兩個線條後,執行Merge命令,那麼在Runtime for Net中如何實現呢?code

開始找了很長時間是否是也有與Merge功能相似的API提供,後來發現可能沒有。須要在建立Geometry時,就設定爲兩個或多個線條。blog

將線條的構成點分別存入兩個PointCollection,而後用PointCollection的列表建立要素便可。  io

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);
相關文章
相關標籤/搜索