如何创建一个要素数据类 IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口
如何创建一个要素数据类
创建要素类用到了IFeatureWorkspace.CreateFeatureClass方法,在这个方法中有众多的参数,为了满足这些参数,我们要学习和了解下面的接口.
IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口
字段对应表中的一列,一个要素类必须有至少2个字段,而多个字段的集合就构成了字段集,在要素类中,有一个特殊的字段,描述了空间对象,我们称之为几何字段,其中GeometryDef是用来设计几何字段的。这个几何字段定义了要素类的类型,比如说我们要在Catalog创建一个点要素类,那么我们必须指定他的类型为Point。
而上面这6个接口,其实是三类,以Edit结尾的接口是可写的,也就是说对字段,字段集合,以及几何字段的编辑都是通过后者完成的。空间数据的一个重要属性就是参考系,参考系也是在GeometryDef中定义的。
注意 在NET中,会遇到以“_2”结尾的属性,这些属性是可写的。
IGeometryDefEdit Interface接口
Members
|
All Properties Methods Inherited Non-inherited |
Description | |
|---|---|---|
![]() |
AvgNumPoints | The estimated average number of points per feature. |
![]() |
AvgNumPoints | The estimated average number of points per feature. |
![]() |
GeometryType | The enumerated geometry type. |
![]() |
GeometryType | The geometry type. |
![]() |
GridCount | The number of spatial index grids. |
![]() |
GridCount | The number of spatial index grids. |
![]() |
GridSize | The size of a spatial index grid. |
![]() |
GridSize | The size of a spatial index grid. |
![]() |
HasM | Indicates if the feature class has measure (M) values. |
![]() |
HasM | Indicates if the feature class will support M values. |
![]() |
HasZ | Indicates if the feature class will support Z values. |
![]() |
HasZ | Indicates if the featureClass has Z values. |
![]() |
SpatialReference | The spatial reference for the dataset. |
![]() |
SpatialReference | The spatial reference of the dataset. |
Inherited Interfaces
| Interfaces | Description |
|---|---|
| IGeometryDef | Provides access to members that return information about the geometry definition. |
Classes that implement IGeometryDefEdit
| Classes | Description |
|---|---|
| GeometryDef | ESRI Geometry Definition object. |
//定义一个几何字段,类型为点类型
ISpatialReference pSpatialReference = axMapControl1.ActiveView.FocusMap.SpatialReference; //空间参考系
IGeometryDefEdit pGeoDef = new GeometryDefClass();
IGeometryDefEdit pGeoDefEdit = pGeoDef as IGeometryDefEdit;
pGeoDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPoint;
pGeoDefEdit.SpatialReference_2 = pSpatialReference;
//定义一个字段集合对象
IFields pFields = new FieldsClass();
IFieldsEdit pFieldsEdit = (IFieldsEdit)pFields;
//定义单个的字段
IField pField = new FieldClass();
IFieldEdit pFieldEdit = (IFieldEdit)pField;
pFieldEdit.Name_2 = "SHAPE";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry;
pFieldsEdit.AddField(pField);
pFieldEdit.GeometryDef_2 = pGeoDef;
//定义单个的字段,并添加到字段集合中
pField = new FieldClass();
pFieldEdit = (IFieldEdit)pField;
pFieldEdit.Name_2 = "STCD";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
pFieldsEdit.AddField(pField);
//定义单个的字段,并添加到字段集合中
pField = new FieldClass();
pFieldEdit = (IFieldEdit)pField;
pFieldEdit.Name_2 = "SLM10";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
pFieldsEdit.AddField(pField);
//定义单个的字段,并添加到字段集合中
pField = new FieldClass();
pFieldEdit = (IFieldEdit)pField;
pFieldEdit.Name_2 = "SLM20";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
pFieldsEdit.AddField(pField);
//定义单个的字段,并添加到字段集合中
pField = new FieldClass();
pFieldEdit = (IFieldEdit)pField;
pFieldEdit.Name_2 = "SLM40";
pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString;
pFieldsEdit.AddField(pField);
IWorkspaceFactory pFtWsFct = new AccessWorkspaceFactory();
IFeatureWorkspace pWs = pFtWsFct.OpenFromFile(@"E:\arcgis\Engine\s.mdb", 0) as
IFeatureWorkspace;
IFeatureClass pFtClass = pWs.CreateFeatureClass("Test", pFields, null, null,
esriFeatureType.esriFTSimple, "SHAPE", null)
如何创建一个要素数据类 IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口的更多相关文章
- 编写Java程序,创建一个父类交通工具类(Vehicles),以及两个子类,分别是轿车类(Car)和卡车类(Truck)。
返回本章节 返回作业目录 需求说明: 创建一个父类交通工具类(Vehicles),以及两个子类,分别是轿车类(Car)和卡车类(Truck). 父类有属性品牌(brand)和颜色(color). 在父 ...
- 编写Java程序,创建一个数学工具类,将该类设计为final类,Final 修饰符的使用。
返回本章节 返回作业目录 需求说明: 创建一个数学工具类. 将该类设计为final类. 将该类的构造方法的访问权限定义为私有,以防止外界实例化该类. 在该类定义静态double类型常量π,其值为3.1 ...
- entity framework 6 我写了一个公用数据类
public class BaseDAL { string strConn = ""; public BaseDAL(string connString) { strConn = ...
- 【iOS开展-50】使用它来创建一个新的类的实现代码包,因此,不自觉地练习简单MVC实验,附带动画
接下来说说代码封装最后一个个案. 最后一种情况看:[iOS开展-48]九宫格案例:自己主动布局.字典转模型运用.id和instancetype差别.xib反复视图运用及与nib关系 (1)代码封装的原 ...
- (转载)使用SQL-Server创建一个银行数据管理系统Ⅰ
首先,要创建一个完整的数据管理系统,不是一蹴而就的,一定要要一步一步的来,不断完善,最终方能达到自己想要的结果,所以我在这里也是一点一点分步来做的. 创建数据库,数据库属性在这里用的是默认(不推荐使用 ...
- 创建一个动作-Action类:
让我们创建一个Java文件HelloWorldAction.java的Java资源> SRC下一个的包名com.yiibai.struts2与下面的内容. package com.yiibai. ...
- UE4编程之C++创建一个FPS工程(二)角色网格、动画、HUD、子弹类
转自:http://blog.csdn.net/u011707076/article/details/44243103 紧接上回,本篇文章将和大家一同整理总结UE4关于角色网格.动画.子弹类和HUD的 ...
- UE4的编程C++创建一个FPSproject(两)角色网格、动画、HUD、子弹类
立即归还,本文将总结所有这些整理UE4有关角色的网络格.动画.子弹类HUD一个简单的实现. (五)角色加入网格 Character类为我们默认创建了一个SkeletaMeshComponent组件,所 ...
- 创建一个抽象的员工类, 抽象开发累继承员工类,JavaEE ,和安卓继承开发类在测试类中进行测试
/* 1 定义一个员工类 所有的子类都抽取(抽象类) Employee 属性:姓名 工号(生成get set ) 方法:工作 抽象 2 定义一个研 ...
随机推荐
- postgres-xl 集体搭建(1)
安装并编辑脚本 cd /opt/curl -O http://files.postgres-xl.org/postgres-xl95r1beta1.tar.gztar -zxvf postgres-x ...
- 使用 Eclipse Memory Analyzer 进行简单内存泄漏分析
Java 内存泄露的根本原因: 保存了不可能再被访问的变量类型的引用.因此我们的目的就是要找出这样的引用. 1.测试代码: public class MainActivity extends Acti ...
- 未能加载文件或程序集“ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73”或它的某一个依赖项
未能加载文件或程序集“ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf116 ...
- linkButton
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...
- Linux 配置tomcat遇见的若干问题
1.提示catalina.sh缺失 原因:未对bin目录下的.sh文件授权 执行:chmod +x bin/*.sh即可 2.正常启动Tomcat 但是外界无法访问 Linux防火墙原因,进入到 et ...
- SLF4JLoggerContext cannot be cast to LoggerContext
Getting Exception org.apache.logging.slf4j.SLF4JLoggerContext cannot be cast to org.apache.logging.l ...
- dos命令(Cacls和Icacls) -- 显示或者修改文件的访问控制表
1. dos帮助说明 cacls /? 注意: 不推荐使用 Cacls,请使用 Icacls. 显示或者修改文件的访问控制列表(ACL) CACLS filename [/T] [/M] [/L] [ ...
- jquery 展开关闭效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Java NIO Related
A file's status is 3-valued: The file is verified to exist; The file is verified to not exist; The f ...
- Android &Swift iOS开发:语言与框架对比
转载自:http://www.infoq.com/cn/articles/from-android-to-swift-ios?utm_campaign=rightbar_v2&utm_sour ...


