zoukankan      html  css  js  c++  java
  • 域子类

          void CreateDomain(IWorkspace pWorkspace)
             {
               
                 IWorkspaceDomains pWorkspaceDomains = (IWorkspaceDomains)pWorkspace;
     
                 ICodedValueDomain pCodedValueDomain = new CodedValueDomainClass();
     
                 pCodedValueDomain.AddCode("RES", "Residential");
                 pCodedValueDomain.AddCode("COM", "Commercial");
                 pCodedValueDomain.AddCode("IND", "Industrial");
     
                 IDomain pDomain = (IDomain)pCodedValueDomain;
                 pDomain.Name = "Building Types";
                 pDomain.FieldType = esriFieldType.esriFieldTypeString;
                 pDomain.SplitPolicy = esriSplitPolicyType.esriSPTDuplicate;
                 pDomain.MergePolicy = esriMergePolicyType.esriMPTDefaultValue;
     
     
                 pWorkspaceDomains.AddDomain(pDomain);
             }
     
      public void AssignDomainToFieldWithSubtypes(IFeatureClass pFeatureClass)
             {
     
                 IDataset pDataset = (IDataset)pFeatureClass;

                 IWorkspace pWorkspace = pDataset.Workspace;
                 IWorkspaceDomains pWorkspaceDomains = (IWorkspaceDomains)pWorkspace;
     
          
                 IDomain pDistributionDiamDomain =
    pWorkspaceDomains.get_DomainByName("DistDiam");
                 
     
                 ISubtypes pSubtypes = (ISubtypes)pFeatureClass;
     
                 pSubtypes.set_Domain(1, "SIZE_ONE", pDistributionDiamDomain);
     
             }
     
     
             public void AddPipeSubtypes(IFeatureClass pFeatureClass)
             {
                 
                 ISubtypes pSubtypes = (ISubtypes)pFeatureClass;
                
                 pSubtypes.SubtypeFieldName = "PipeType";
     
                 pSubtypes.AddSubtype(1, "Primary");
                 pSubtypes.AddSubtype(2, "Secondary");
     
                 pSubtypes.DefaultSubtypeCode = 1;
             }
     

  • 相关阅读:
    Selct 大全
    Web API
    其他
    ADO.NET Entity Framework
    ORACLE SQL前端补0的三种方式。
    linux常用命令
    oracle 创建修改 job
    oracle 如何恢复误删的表记录数据
    myeclipse上SVN代码合并详细步骤图解
    SVN创建资源与分支详解
  • 原文地址:https://www.cnblogs.com/qiushuixizhao/p/3242914.html
Copyright © 2011-2022 走看看