日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

创建、添加字段IFields

發(fā)布時(shí)間:2025/5/22 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 创建、添加字段IFields 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

轉(zhuǎn)載自:http://blog.sina.com.cn/s/blog_84f7fbbb010199gx.html

從ACCESS讀取數(shù)據(jù)到ArcGIS個(gè)人數(shù)據(jù)庫(kù)并創(chuàng)建Feature Class(point)

轉(zhuǎn)載:http://www.cnblogs.com/qiushuixizhao/p/3242685.html

如何創(chuàng)建一個(gè)要素?cái)?shù)據(jù)類 IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口

如何創(chuàng)建一個(gè)要素?cái)?shù)據(jù)類?
創(chuàng)建要素類用到了IFeatureWorkspace.CreateFeatureClass方法,在這個(gè)方法中有眾多的參數(shù),為了滿足這些參數(shù),我們要學(xué)習(xí)和了解下面的接口.?
IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口?
字段對(duì)應(yīng)表中的一列,一個(gè)要素類必須有至少2個(gè)字段,而多個(gè)字段的集合就構(gòu)成了字段集,在要素類中,有一個(gè)特殊的字段,描述了空間對(duì)象,我們稱之為幾何字段,其中GeometryDef是用來(lái)設(shè)計(jì)幾何字段的。這個(gè)幾何字段定義了要素類的類型,比如說(shuō)我們要在Catalog創(chuàng)建一個(gè)點(diǎn)要素類,那么我們必須指定他的類型為Point。

而上面這6個(gè)接口,其實(shí)是三類,以Edit結(jié)尾的接口是可寫的,也就是說(shuō)對(duì)字段,字段集合,以及幾何字段的編輯都是通過(guò)后者完成的??臻g數(shù)據(jù)的一個(gè)重要屬性就是參考系,參考系也是在GeometryDef中定義的。?
注意 在NET中,會(huì)遇到以“_2”結(jié)尾的屬性,這些屬性是可寫的。

IGeometryDefEdit Interface接口

Members

?? All ? Properties ? Methods ? Inherited ? Non-inherited ?Description
?AvgNumPointsThe estimated average number of points per feature.
?AvgNumPointsThe estimated average number of points per feature.
?GeometryTypeThe enumerated geometry type.
?GeometryTypeThe geometry type.
?GridCountThe number of spatial index grids.
?GridCountThe number of spatial index grids.
?GridSizeThe size of a spatial index grid.
?GridSizeThe size of a spatial index grid.
?HasMIndicates if the feature class has measure (M) values.
?HasMIndicates if the feature class will support M values.
?HasZIndicates if the feature class will support Z values.
?HasZIndicates if the featureClass has Z values.
?SpatialReferenceThe spatial reference for the dataset.
?SpatialReferenceThe spatial reference of the dataset.

?

?

//定義一個(gè)幾何字段,類型為點(diǎn)類型 ISpatialReference pSpatialReference = axMapControl1.ActiveView.FocusMap.SpatialReference; //空間參考系IGeometryDefEdit pGeoDef = new GeometryDefClass(); IGeometryDefEdit pGeoDefEdit = pGeoDef as IGeometryDefEdit; pGeoDefEdit.GeometryType_2 = esriGeometryType.esriGeometryPoint; pGeoDefEdit.SpatialReference_2 = pSpatialReference; //定義一個(gè)字段集合對(duì)象 IFields pFields = new FieldsClass(); IFieldsEdit pFieldsEdit = (IFieldsEdit)pFields; //定義單個(gè)的字段 IField pField = new FieldClass(); IFieldEdit pFieldEdit = (IFieldEdit)pField; pFieldEdit.Name_2 = "SHAPE"; pFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry; pFieldsEdit.AddField(pField); pFieldEdit.GeometryDef_2 = pGeoDef; //定義單個(gè)的字段,并添加到字段集合中 pField = new FieldClass(); pFieldEdit = (IFieldEdit)pField; pFieldEdit.Name_2 = "STCD"; pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString; pFieldsEdit.AddField(pField); //定義單個(gè)的字段,并添加到字段集合中 pField = new FieldClass(); pFieldEdit = (IFieldEdit)pField; pFieldEdit.Name_2 = "SLM10"; pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString; pFieldsEdit.AddField(pField); //定義單個(gè)的字段,并添加到字段集合中 pField = new FieldClass(); pFieldEdit = (IFieldEdit)pField; pFieldEdit.Name_2 = "SLM20"; pFieldEdit.Type_2 = esriFieldType.esriFieldTypeString; pFieldsEdit.AddField(pField); //定義單個(gè)的字段,并添加到字段集合中 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)

?創(chuàng)建字段

方法一:IQueryFilter接口

Description
IQueryFilterfilters data based on an attribute query. A string defining a where clause is required. An optional list of columns may be included to specify the column values to be retrieved. If no columns are specified, all values will be returned.

When To Use
When you need to filter data based on attribute values or the relationships between attributes.

Members

?

Method         AddField          Appends a single field name to the list of sub-fields.
Read/write property   OutputSpatialReference    ?The spatial reference in which to output geometry for a given field.
Read/write property   SubFields          The comma delimited list of field names for the filter.
Read/write property   WhereClause        The where clause for the filter.


?

轉(zhuǎn)載于:https://www.cnblogs.com/marvelousone/p/7457436.html

總結(jié)

以上是生活随笔為你收集整理的创建、添加字段IFields的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。