ArcSDE:C#创建SDE要素数据集

转自原文 ArcSDE:C#创建SDE要素数据集

    /// <summary>
/// 判断指定数据集是否存在
/// </summary>
/// <param name="workspace">工作空间名称</param>
/// <param name="strDataSetName">数据集名称</param>
/// <returns>存在,true;否则,false</returns>
public static bool isDatasetExist(IWorkspace workspace, string strDataSetName)
{
if (workspace == null)
{
return false;
}
else if (workspace.get_NameExists(esriDatasetType.esriDTFeatureDataset, strDataSetName))
{
return true;
}
else
{
return false;
}
}
    /// <summary>
/// 创建要素数据集
/// </summary>
/// <param name="workspace">工作空间名称</param>
/// <param name="strDatasetName">数据集名称</param>
/// <param name="spatialReference">参考系</param>
public static void CreateFeatureDataset(IWorkspace workspace,string strDatasetName, ISpatialReference spatialReference)
{
IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace;
if (featureWorkspace == null)
return;
if (!isDatasetExist(strDatasetName))
{
featureWorkspace.CreateFeatureDataset(strDatasetName, spatialReference);
}
}
上一篇:hadoop2.7集群安装


下一篇:数据库、ArcCatalog空间数据源正常访问,数据库设置没问题时,ArcEngine连接SDE时报"ORA-12560: TNS: 协议适配器错误"的解决办法;ArcEngine连接SDE总结