打开FileGeoDatabase中要素类

private IFeatureClass OpenFileGdbFtCls(string fn)
        {
            IFeatureClass pftcls = null;
            IWorkspaceFactory wsfactory = new FileGDBWorkspaceFactoryClass();
            IWorkspace ws = wsfactory.OpenFromFile(System.IO.Path.GetDirectoryName(fn),0);
            IFeatureWorkspace fws = ws as IFeatureWorkspace;
            pftcls = fws.OpenFeatureClass(System.IO.Path.GetFileNameWithoutExtension(fn));
            return pftcls;
        }

代码如上

posted @ 2015-07-07 08:50  DayDreamInGIS  阅读(352)  评论(0编辑  收藏  举报