码迷,mamicode.com
首页 > 其他好文 > 详细

ArcGIS Engine检索要素集、要素类和要素

时间:2017-05-21 17:53:56      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:classes   sdn   datasets   获取   sse   slist   href   cgi   ase   

转自原文 ArcGIS Engine检索要素集、要素类和要素

 

            /// <summary>  
            /// 获取所有要素集  
            /// </summary>  
            /// <param name="workspace">工作空间对象</param>  
            /// <returns>要素集列表</returns>  
            public static List<IFeatureDataset> GetAllFeatureClass(IWorkspace workspace)  
            {  
                IEnumDataset dataset = workspace.get_Datasets(esriDatasetType.esriDTFeatureDataset);  
                IFeatureDataset featureDataset = dataset.Next() as IFeatureDataset;  
      
      
                List<IFeatureDataset> featureDatasetList = new List<IFeatureDataset>();  
                while (featureDataset != null)  
                {  
                    featureDatasetList.Add(featureDataset);  
                    featureDataset = dataset.Next() as IFeatureDataset;  
                }  
                return featureDatasetList;  
            }  

 

    /// <summary>  
    /// 获取所有要素类  
    /// </summary>  
    /// <param name="featureDataset">要素集</param>  
    /// <returns>要素类列表</returns>  
    public static List<IFeatureClass> GetAllFeatureClass(IFeatureDataset featureDataset)  
    {  
        IFeatureClassContainer featureClassContainer = (IFeatureClassContainer)featureDataset;  
        IEnumFeatureClass enumFeatureClass = featureClassContainer.Classes;  
        IFeatureClass featureClass = enumFeatureClass.Next();  
      
        List<IFeatureClass> featureClassList = new List<IFeatureClass>();  
        while (featureClass != null)  
        {  
            featureClassList.Add(featureClass);  
            featureClass = enumFeatureClass.Next();  
        }  
        return featureClassList;  
    }  

 

    /// <summary>  
    /// 获取所有要素  
    /// </summary>  
    /// <param name="featureClass">要素类</param>  
    /// <returns>要素列表</returns>  
    public static List<IFeature> GetAllFeatureClass(IFeatureClass featureClass)  
    {  
        List<IFeature> featureList = new List<IFeature>();  
        IFeatureCursor featureCursor = featureClass.Search(null, false);  
        IFeature feature = featureCursor.NextFeature();  
      
        while (feature != null)  
        {  
            featureList.Add(feature);  
            feature = featureCursor.NextFeature();  
        }  
        return featureList;  
    }  

 

ArcGIS Engine检索要素集、要素类和要素

标签:classes   sdn   datasets   获取   sse   slist   href   cgi   ase   

原文地址:http://www.cnblogs.com/arxive/p/6885312.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!