IFeature和IPoint接口的转换以及文…
IFeature和IPoint接口的转换以及文件读取//读取硬盘上的shp数据IWorkspaceFactory pWsFac = newShapefileWorkspaceFactoryClass();IWorkspace pWs = pWsFac.OpenFromFile(@"E:", 0);IFeatureWorkspace pFWs = pWs as IFeatureWorkspace;IFeatureClass pointsClass =pFWs.OpenFeatureClass("randomPoints2");IFeatureCursor featureCursor = pFeatClass.Search(null,true); IFeature feature =featureCursor.NextFeature();IPointCollection pointsColl = newMultipointClass(); while (feature != null) { IPoint pt= new PointClass(); pt =feature.Shape as IPoint;/////////// pointsColl.AddPoint(pt); }