IPointCollection转IPolyline
IPointCollection转线IPolyline:
1 IPolyline pl = new PolylineClass(); 2 3 IPointCollection ptc = pl as IPointCollection; 4 5 object missing = Type.Missing; 6 7 for (int i = 0; i < num1; i++) 8 { 9 IPoint pt = autoStation.GetFeature(i).Shape as IPoint;//提取点 10 ptc.AddPoint(pt, missing, missing); 11 12 } 13 14 (pl as ITopologicalOperator).Simplify();
//把IPolyline插入到IFeatureClass中
1 IFeatureClass f1 = (ws as IFeatureWorkspace).OpenFeatureClass("bb1"); 2 IFeature fea=f1.CreateFeature(); 3 fea.Shape = pl; 4 fea.Store();
自己总结一下,省的每次用的时候还得翻箱倒柜。