IFeature和IPoint接口的转换以及文件读取
//读取硬盘上的shp数据
IWorkspaceFactory pWsFac = new ShapefileWorkspaceFactoryClass();
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 = new MultipointClass();
while (feature != null)
{
IPoint pt = new PointClass();
pt = feature.Shape as IPoint;///
pointsColl.AddPoint(pt);
}