IPointCollection转IPolyline_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > IPointCollection转IPolyline

IPointCollection转IPolyline

 2013/8/23 19:17:42  安然enron  博客园  我要评论(0)
  • 摘要:IPointCollection转线IPolyline:IPolylinepl=newPolylineClass();IPointCollectionptc=plasIPointCollection;objectmissing=Type.Missing;for(inti=0;i<num1;i++){IPointpt=autoStation.GetFeature(i).ShapeasIPoint;//提取点ptc.AddPoint(pt,missing,missing);}
  • 标签:

IPointCollection转线IPolyline:

IPolyline pl =  new PolylineClass();

IPointCollection ptc = pl as IPointCollection;

object missing = Type.Missing;

for (int i = 0; i < num1; i++) 
{
          IPoint pt = autoStation.GetFeature(i).Shape as IPoint;//提取点
          ptc.AddPoint(pt, missing, missing);

}

(pl as ITopologicalOperator).Simplify();

//把IPolyline插入到IFeatureClass中
IFeatureClass f1 = (ws as IFeatureWorkspace).OpenFeatureClass("bb1");
IFeature fea=f1.CreateFeature();
fea.Shape = pl;
fea.Store();

自己总结一下,省的每次用的时候还得翻箱倒柜。

  • 相关文章
发表评论
用户名: 匿名