在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
很久不搞又有点忘记了,干脆记下来,免得到处找 一、 通过FeatureLayer 找到数据库 IfeatureClas featClass = featureLayer.FeatureClass; IDataSet dataset = featClass as IDataset; IWorkspace ws = dataset.Workspace;
二、 通过数据库文件读取数据 IWorkspaceFactory wsf = new ShapefileWorkspaceFactory(); IWorkspace pWorkspace = wsf.Open(filePath, 0) ;//filePath为shapefile所在的文件夹 IFeatureWorkspace pFeatureWorkspace = pWorkspace ; IFeatureClass pFeatureClass = pFeatureWorkspace.OpenFeatureClass("parcels");//parcels为shapefile文件名pacels.shp
|
请发表评论