ArcEngine创建要素类_线类型
public ESRI.ArcGIS.Geodatabase.IFeatureClass CreateFeatureClassForLine(ESRI.ArcGIS.Geodatabase.IWorkspace2 workspace, ESRI.ArcGIS.Geodatabase.IFeatureDataset featureDataset, System.String featureClassName) { ESRI.ArcGIS.esriSystem.UID CLSID = null; ESRI.ArcGIS.esriSystem.UID CLSEXT = null; System.String strConfigKeyword = null; if (featureClassName == "") return null; // name was not passed in ESRI.ArcGIS.Geodatabase.IFeatureClass featureClass; ESRI.ArcGIS.Geodatabase.IFeatureWorkspace featureWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)workspace; // Explicit Cast if (workspace.get_NameExists(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureClass, featureClassName)) //feature class with that name already exists { featureClass = featureWorkspace.OpenFeatureClass(featureClassName); return featureClass; } // assign the class id value if not assigned if (CLSID == null) { CLSID = new ESRI.ArcGIS.esriSystem.UIDClass(); CLSID.Value = "esriGeoDatabase.Feature"; //CLSID.Value = "esriGeometryType.esriGeometryPolyline"; } ESRI.ArcGIS.Geodatabase.IObjectClassDescription objectClassDescription = new ESRI.ArcGIS.Geodatabase.FeatureClassDescriptionClass(); ESRI.ArcGIS.Geodatabase.IFields fields = null; // if a fields collection is not passed in then supply our own if (fields == null) { // create the fields using the required fields method fields = objectClassDescription.RequiredFields; ESRI.ArcGIS.Geodatabase.IFieldsEdit fieldsEdit = (ESRI.ArcGIS.Geodatabase.IFieldsEdit)fields; // Explicit Cast ESRI.ArcGIS.Geodatabase.IField field = new ESRI.ArcGIS.Geodatabase.FieldClass(); // create a user defined text field ESRI.ArcGIS.Geodatabase.IFieldEdit fieldEdit = (ESRI.ArcGIS.Geodatabase.IFieldEdit)field; // Explicit Cast // setup field properties fieldEdit.Name_2 = "ZBDID"; fieldEdit.Type_2 = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString; fieldEdit.IsNullable_2 = true; fieldEdit.AliasName_2 = "坐标编号"; fieldEdit.DefaultValue_2 = "; fieldEdit.Editable_2 = true; fieldEdit.Length_2 = ; // add field to field collection fieldsEdit.AddField(field); fields = (ESRI.ArcGIS.Geodatabase.IFields)fieldsEdit; // Explicit Cast } System.String strShapeField = ""; // locate the shape field ; j < fields.FieldCount; j++) { if (fields.get_Field(j).Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeGeometry) { //strShapeField = fields.get_Field(j).Name; IField shapeField = fields.get_Field(j); strShapeField = fields.get_Field(j).Name; IGeometryDef geometryDef = shapeField.GeometryDef; IGeometryDefEdit geometryDefEdit = (IGeometryDefEdit)geometryDef; // Alter the feature class geometry type to lines (default is polygons). geometryDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPolyline; geometryDefEdit.HasM_2 = true; geometryDefEdit.GridCount_2 = ; // Set the first grid size to zero and allow ArcGIS to determine a valid grid size. geometryDefEdit.set_GridSize(, ); ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass(); geometryDefEdit.SpatialReference_2 = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Beijing1954); break; } } // Use IFieldChecker to create a validated fields collection. ESRI.ArcGIS.Geodatabase.IFieldChecker fieldChecker = new ESRI.ArcGIS.Geodatabase.FieldCheckerClass(); ESRI.ArcGIS.Geodatabase.IEnumFieldError enumFieldError = null; ESRI.ArcGIS.Geodatabase.IFields validatedFields = null; fieldChecker.ValidateWorkspace = (ESRI.ArcGIS.Geodatabase.IWorkspace)workspace; fieldChecker.Validate(fields, out enumFieldError, out validatedFields); // The enumFieldError enumerator can be inspected at this point to determine // which fields were modified during validation. // finally create and return the feature class if (featureDataset == null)// if no feature dataset passed in, create at the workspace level { featureClass = featureWorkspace.CreateFeatureClass(featureClassName, validatedFields, CLSID, CLSEXT, ESRI.ArcGIS.Geodatabase.esriFeatureType.esriFTSimple, strShapeField, strConfigKeyword); } else { featureClass = featureDataset.CreateFeatureClass(featureClassName, validatedFields, CLSID, CLSEXT, ESRI.ArcGIS.Geodatabase.esriFeatureType.esriFTSimple, strShapeField, strConfigKeyword); } return featureClass; }
ArcEngine创建要素类_线类型的更多相关文章
- ArcGIS创建要素类
在使用ARCGIS软件进行工作时,免不了要建立地理数据库和要素类之类的.一下是我创建文件地理数据库并在数据库中创建要素类写相关步骤: 1.启动软件,可以使用ARCCatalog直接进行创建也可以使用A ...
- 用ArcMap在PostgreSQL中创建要素类需要执行”create enterprise geodatabase”吗
问:用Acmap在PostgreSQL中创建要素类需要执行"create enterprise geodatabase"吗? 关于这个问题,是在为新员工做postgresql培训后 ...
- Geodatabase - 创建要素类.
在NET中,会遇到以“_2”结尾的属性,这些属性是可写的. 以下代码在已有工作空间下,创建一个新的点要素类: //例如,personalDBPath=@"G:\doc\gis\1.400\d ...
- arcengine新建要素类
ArcGIS里面新建数据集,看起来简单,平时都是默认创建,实际上好多细节问题我们都没注意到 一.在数据集上新建要素类: How to create a feature class within a f ...
- ArcEngine 创建要素,删除要素,生成网格,渲染图层(VB)
示例代码:https://github.com/yu969890202/ArcEngine/tree/master/WinFrom_ArcEngine_PointDistribution博客后面有两张 ...
- AE二次开发中几个功能速成归纳(符号设计器、创建要素、图形编辑、属性表编辑、缓冲区分析)
/* * 实习课上讲进阶功能所用文档,因为赶时间从网上抄抄改改,凑合能用,记录一下以备个人后用. * * ----------------------------------------------- ...
- ArcEngine 创建线要素图层
在创建要素图层的时候,默认的几何类型是Polygon: Dim objectClassDescription As IObjectClassDescription = New FeatureClass ...
- ArcGIS 网络分析[1.1] 创建用于网络分析用的线类型shp文件[这个太基础了吧!]
具体的准备,在上一篇就说过了,不再赘述. 阅读本篇前,需要的预备知识是:ArcGIS创建各种矢量数据的方法,了解地理坐标与投影坐标 本篇只创建单一的线数据,至于点数据,以后进行复杂的网络分析时再添加进 ...
- arcengine 要素类的复制
转自原文arcengine 要素类的复制 using System; using System.Collections.Generic; using System.Text; using ESRI.A ...
随机推荐
- 8 -- 深入使用Spring -- 4...1 为什么需要AOP
8.4.1 为什么需要AOP AOP专门用于处理系统中分布于各种模块(不同方法)中的交叉关注点的问题,在Java EE应用中,常常通过AOP来处理一些具有横切性质的系统级服务,如事务管理.安全检查.缓 ...
- 笔记--Wcf全面解析(上)---(1)
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel; using ...
- vux 使用 font-awesome
1)XIcon 太多坑,不好用,无奈之下,搞了一下 font-awesome 2)下载 font-awesome 源码,并放置到 根目录/src 目录下 ,传送门:http://fontawesome ...
- Explaining Delegates in C# - Part 5 (Asynchronous Callback - Way 2)
In this part of making asynchronous programming with delegates, we will talk about a different way, ...
- linux 下的爆破工具hydra
http://www.cnblogs.com/mchina/archive/2013/01/01/2840815.html 安装手册 http://www.aldeid.com/wiki/Thc-hy ...
- O2O(online to offline)营销模式
O2O营销模式又称离线商务模式,是指线上营销线上购买带动线下经营和线下消费.O2O通过打折.提供信息.服务预订等方式,把线下商店的消息推送给互联网用户,从而将他们转换为自己的线下客户,这就特别适合必须 ...
- iOS - UIScrollView 相关属性代理详解
一.UIScrollView的属性和代理方法详解 属性: - (void)viewDidLoad { [super viewDidLoad]; _scrollView.backgroundColor ...
- java远程连接access数据库
本文转载自http://www.voidcn.com/article/p-tlrtkqlp-k.html 1 rmijdbc远程连接access数据库 正常情况下,常用的数据库sql server, ...
- PHP错误 。Parse error: syntax error, unexpected T_INLINE_HTML, expecting T_ENDSWITCH or T_CASE or T_DEFAULT
If you wan't to use the alternative syntax for switch statements this won't work: <div> <?p ...
- SQL - 根据天来分组比较
SELECT COUNT(*) FROM (SELECT WeixinUserID,CONVERT(varchar(100),CreateTime, 23) AS DT FROM SiteVisite ...