zoukankan      html  css  js  c++  java
  • 转载别人(ZZ)创建要素集

     感觉写的很实在且内容较多,转来,可以用于以后检索

    3月19日

    ArGis实现创建要素类

            public IFeatureClass createFeatureClass( string strBrowseName)
            {
                IWorkspaceFactory pWSF;
                pWSF = new AccessWorkspaceFactoryClass();
                IWorkspace pWS;
                pWS = pWSF.OpenFromFile(@"E:\T.mdb", 0);
                IFeatureWorkspace pFWS;
                pFWS = pWS as IFeatureWorkspace;
               
                IGeometryDefEdit pGeomDef;
                pGeomDef = new GeometryDefClass();

                pGeomDef.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
                pGeomDef.SpatialReference_2 = new UnknownCoordinateSystemClass();
                pGeomDef.SpatialReference.SetDomain(0, 10000000, 0, 10000000);
                pGeomDef.SpatialReference.SetZDomain(0, 100);//创建要素类一定要加上空间阈,否则不会创建成功!!!


                IFieldEdit pField;
                IFieldsEdit pFieldsEdit;
                pFieldsEdit = new FieldsClass();
               
                pField = new FieldClass();
                pField.Type_2 = esriFieldType.esriFieldTypeGeometry;
                pField.GeometryDef_2 = pGeomDef;
                pField.Name_2 = "shape";
                pFieldsEdit.AddField(pField);
               
                pField = new FieldClass();
                pField.Type_2 = esriFieldType.esriFieldTypeDouble;
                pField.Name_2 = "ID";
                pFieldsEdit.AddField(pField);

                pField = new FieldClass();
                pField.Name_2 = "OBJECTID";
                pField.Type_2 = esriFieldType.esriFieldTypeOID;
                pFieldsEdit.AddField(pField);
                MessageBox.Show("Cuole");
                return  pFWS.CreateFeatureClass(strBrowseName, pFieldsEdit, null, null, esriFeatureType.esriFTSimple, "Shape", "");
            }

            private void button4_Click(object sender, EventArgs e)
            {
         //       string s=@"E:\T.mdb";
                string t="Had";
                IFeatureClass pFeature = createFeatureClass(t);
                MessageBox.Show("Cuole");
            }
    14:30 | 写入日志
  • 相关阅读:
    (转)PHP 的 __FILE__ 常量
    smarty半小时快速上手教程(转)
    Namespace declaration statement has to be the very first
    ThinkPhp3.2 无法加载模块:Index
    注意mysql中的编码格式和php中的编码格式一致
    MySQL数据库备份与恢复方法(转)
    phpmyadmin设置id自增(AUTO_INCREMENT)(转)
    (转)用eclipse创建一个j2ee的web工程后,左面projects窗口中的项目如何没有显示webRoot文件夹,除了src的文件夹,其他都不显示
    CentOS6.8 安装 Nginx
    Eclipse Java注释模板设置详解
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/1753385.html
Copyright © 2011-2022 走看看