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

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

 

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

 

复制代码
    ///   
    /// 获取所有要素类  
    ///   
    /// 要素集  
    /// 要素类列表  
    public static List GetAllFeatureClass(IFeatureDataset featureDataset)  
    {  
        IFeatureClassContainer featureClassContainer = (IFeatureClassContainer)featureDataset;  
        IEnumFeatureClass enumFeatureClass = featureClassContainer.Classes;  
        IFeatureClass featureClass = enumFeatureClass.Next();  
      
        List featureClassList = new List();  
        while (featureClass != null)  
        {  
            featureClassList.Add(featureClass);  
            featureClass = enumFeatureClass.Next();  
        }  
        return featureClassList;  
    }  
复制代码

 

复制代码
    ///   
    /// 获取所有要素  
    ///   
    /// 要素类  
    /// 要素列表  
    public static List GetAllFeatureClass(IFeatureClass featureClass)  
    {  
        List featureList = new List();  
        IFeatureCursor featureCursor = featureClass.Search(null, false);  
        IFeature feature = featureCursor.NextFeature();  
      
        while (feature != null)  
        {  
            featureList.Add(feature);  
            feature = featureCursor.NextFeature();  
        }  
        return featureList;  
    }  
复制代码

 

没有整理与归纳的知识,一文不值!高度概括与梳理的知识,才是自己真正的知识与技能。 永远不要让自己的自由、好奇、充满创造力的想法被现实的框架所束缚,让创造力自由成长吧! 多花时间,关心他(她)人,正如别人所关心你的。理想的腾飞与实现,没有别人的支持与帮助,是万万不能的。



    本文转自wenglabs博客园博客,原文链接:http://www.cnblogs.com/arxive/p/6885312.html ,如需转载请自行联系原作者




你可能感兴趣的:(ArcGIS Engine检索要素集、要素类和要素)