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


    转自原文 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;  
        }  
  • 相关阅读:
    【组合数学】AGC036C
    【数位贪心】loj#530. 「LibreOJ β Round #5」最小倍数
    【概率dp】vijos 3747 随机图
    【线段树 经典技巧】10.7序列绝对值
    【杂题】10.7爬树
    【组合数学 思维题】10.6种树
    【换根dp】9.22小偷
    【高维前缀和】8.15B. 组合数
    【技巧 dp】1566: [NOI2009]管道取珠
    【经典dp 技巧】8.13序列
  • 原文地址:https://www.cnblogs.com/arxive/p/6885312.html
Copyright © 2020-2023  润新知