using ESRI.ArcGIS.Geodatabase; using System; using System.Collections.Generic; using System.Linq; using System.Text; using ESRI.ArcGIS.Geometry; namespace Kingo.RuleCheck.AEHelper { public interface IWorkspaceAPI { /// /// 当前工作空间对象 /// IWorkspace CurrentWorkspace { get; } ///// ///// 打开工作空间 ///// //IWorkspace OpenWorkspace(string pStrConnection, WorkspaceTypeEnum pWorkspaceType); ///// ///// 打开工作空间 ///// //IWorkspace OpenWorkspace(IWorkspace pWorkspace); IFeatureClassAPI OpenFeatureClass(string pFeatureClassName); IFeatureClassAPI OpenFeatureClass2(string pFeatureClassName); ITableAPI OpenTable(string pTableName); /// /// 关闭/释放工作空间 /// /// 关闭工作空间时是否压缩数据库,默认压缩 /// bool CloseWorkspace(bool compactAccess = true); /// /// 创建本地工作空间 /// /// 指定路径 IWorkspace CreateLocalWorkspace(string pPath); /// /// 通过路径获取IWorkspace /// /// /// /// IWorkspace GetWorkspace(string sFilePath) where T : ESRI.ArcGIS.Geodatabase.IWorkspaceFactory, new(); /// /// 删除本地工作空间 /// /// 路径 bool DeleteLocalWorkspace(string pPath); /// /// 在指定数据集中创建要素类 /// /// 要素类名称 /// 字段集合 /// 数据集 IFeatureClassAPI CreateFeatureClass(string pFeatureClassName, IFeatureDataset pFeatureDataset, ISpatialReference pSpatialReference, esriGeometryType esriGeoType = esriGeometryType.esriGeometryPolygon, IFields pFields = null); /// /// 在当前工作空间中创建要素类 /// /// 要素类名称 /// 字段集合 IFeatureClassAPI CreateFeatureClass(string pFeatureClassName, ISpatialReference pSpatialReference, IFields pFields); /// /// /// /// /// /// /// IFeatureClassAPI CreateFeatureClass(string pFeatureClassName, ISpatialReference pSpatialReference, esriGeometryType pGeometryType); /// /// 在当前工作空间中创建表 /// /// 表名 /// 表字段集合 ITableAPI CreateTable(string pTableName, IFields pFields); /// /// 获取数据库下所有的要素类 /// /// /// Dictionary GetFeatureClassName(esriDatasetType pDatasetType); /// /// 获取数据库下的要素集和要素类 /// /// /// Dictionary GetDataSetAndFeatureClassName(esriDatasetType pDatasetType); /// /// 获取数据库下所有的属性表 /// /// /// Dictionary GetPropertyTable(esriDatasetType pDatasetType); List GetAllFeatureClass(esriDatasetType pDatasetType); /// /// 删除要素类 /// /// 要删除要素类的名称 /// bool DeleteFeatureClass(string featureClassName); /// /// 是否存在要素类 /// /// /// bool ExistFeatureClass(string featureClassName); } }