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


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

    1.         /// <summary>  
    2.         /// 获取所有要素集  
    3.         /// </summary>  
    4.         /// <param name="workspace">工作空间对象</param>  
    5.         /// <returns>要素集列表</returns>  
    6.         public static List<IFeatureDataset> GetAllFeatureClass(IWorkspace workspace)  
    7.         {  
    8.             IEnumDataset dataset = workspace.get_Datasets(esriDatasetType.esriDTFeatureDataset);  
    9.             IFeatureDataset featureDataset = dataset.Next() as IFeatureDataset;  
    10.   
    11.   
    12.             List<IFeatureDataset> featureDatasetList = new List<IFeatureDataset>();  
    13.             while (featureDataset != null)  
    14.             {  
    15.                 featureDatasetList.Add(featureDataset);  
    16.                 featureDataset = dataset.Next() as IFeatureDataset;  
    17.             }  
    18.             return featureDatasetList;  
    19.         }  
    1. /// <summary>  
    2. /// 获取所有要素类  
    3. /// </summary>  
    4. /// <param name="featureDataset">要素集</param>  
    5. /// <returns>要素类列表</returns>  
    6. public static List<IFeatureClass> GetAllFeatureClass(IFeatureDataset featureDataset)  
    7. {  
    8.     IFeatureClassContainer featureClassContainer = (IFeatureClassContainer)featureDataset;  
    9.     IEnumFeatureClass enumFeatureClass = featureClassContainer.Classes;  
    10.     IFeatureClass featureClass = enumFeatureClass.Next();  
    11.   
    12.     List<IFeatureClass> featureClassList = new List<IFeatureClass>();  
    13.     while (featureClass != null)  
    14.     {  
    15.         featureClassList.Add(featureClass);  
    16.         featureClass = enumFeatureClass.Next();  
    17.     }  
    18.     return featureClassList;  
    19. }  
    1. /// <summary>  
    2. /// 获取所有要素  
    3. /// </summary>  
    4. /// <param name="featureClass">要素类</param>  
    5. /// <returns>要素列表</returns>  
    6. public static List<IFeature> GetAllFeatureClass(IFeatureClass featureClass)  
    7. {  
    8.     List<IFeature> featureList = new List<IFeature>();  
    9.     IFeatureCursor featureCursor = featureClass.Search(null, false);  
    10.     IFeature feature = featureCursor.NextFeature();  
    11.   
    12.     while (feature != null)  
    13.     {  
    14.         featureList.Add(feature);  
    15.         feature = featureCursor.NextFeature();  
    16.     }  
    17.     return featureList;  
  • 相关阅读:
    【刷题】LeetCode刷刷刷 — 2021-05-31(2)
    【刷题】LeetCode刷刷刷 — 2021-05-31(1)
    【刷题】LeetCode刷刷刷 — 2021-05-30(2)
    适配器模式
    跨端开发框架各方评价【整合】+思索
    uni-app运行到小程序报错onStreamRead
    序列化
    tkinter---GUI
    tkinter--抽奖
    6位数(字母和数字)验证码
  • 原文地址:https://www.cnblogs.com/arxive/p/6305415.html
Copyright © 2020-2023  润新知