注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

快乐小屋

 
 
 

日志

 
 

ArcGIS连接Sde对表的操作  

2013-08-26 20:42:42|  分类: sde |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Table, object class, and feature class 
A Table object has one or more columns, referred to as fields, and contains an unordered collection of rows. For each field, each row has exactly one value in the data type of the field. 
A table is a dataset. Properties, such as the name of the table, the persistable name object for the table, and the workspace containing the table can be obtained via the IDataset interface. See the following illustration showing Table, ObjectClass, and FeatureClass objects:
 
In relational terms, a Table object represents a RDBMS table or view. In objected oriented terms, a Table object represents an ObjectClass or a RelationshipClass in a geodatabase. A Table object hands out Row objects that support application callable methods, depending on the type of data stored in the table. The Name property of a table, accessible via the IDataset interface, returns its fully qualified name. See the following illustration showing Dataset and Table objects:
 
The level of qualification can vary depending on the host database management system (DBMS). For example, a table (pipes) owned by a user (gas) may be called pipes in Microsoft Access, gas.pipes in Oracle, and mydb.gas.pipes in SQL Server. The ParseTableName method on the ISQLSyntax interface supported by the table's workspace can be used to split the fully qualified name into its components. 
An object class is a table whose rows represent entities modeled as objects with properties and behavior. The Row objects handed out by an object class support the IRow and the IObject interfaces. See the following illustration showing Dataset, Table, and ObjectClass objects:
 
An object class can participate in any number of relationship classes that relate its instances to objects (entities) in other object classes. An object class can contain a discriminating field (subtype field), that can be used to partition its instances into a number of subtypes. All subtypes share the same field definition and are stored in the same table; however, individual subtypes can differ in the default values and domains assigned to fields. The subtyping mechanism can also be used in defining attribute, connectivity, and topology rules that apply to the instances of the object class. The subtyping mechanism is a lightweight alternative to creating multiple subclasses, and each is represented by its own object class. 
An object class has a non-negative object class ID that is unique in the geodatabase. This ID is assigned to the object class when it is created or when an existing table in the RDBMS is registered with the geodatabase as an object class. The name of the object class is the same as the name of the table in the DBMS in which the objects in the object class are stored and follows the same fully qualified naming conventions. 
An object class can have a GetAliasName property that is stored as part of its definition by the geodatabase. The GetAliasName can be retrieved and used for display purposes by applications. See the following illustration showing IObjectClass:
 
An object class may have a ModelName property that is stored as part of its definition by the geodatabase. The model name is not exposed to end users and if defined, can be used as a search key to find an object class by a standard model name that is adhered to across databases. A model name must be unique across the workspace. 
Although all objects in a feature class or object class must have the same behavior and attributes, not all objects have to share the same default values and validation rules. You can group features and objects into subtypes. Subtypes differentiate objects based on their rules. 
A FeatureClass is an ObjectClass whose objects are features, that is, a feature class is a collection of spatial entities, modeled as objects with properties and behavior. All of the features in a feature class share the same attribute schema (have the same set of named fields). The row objects handed out by a feature class support the IRow, IObject, and IFeature interfaces. See the following illustration showing the Dataset, Table, ObjectClass, and FeatureClass objects.
 
A feature class has one distinguished shape field (type Geometry). The shape field stores the geometry (shape property) for the features in the feature class. 
The following code example uses the Workspace object to return a FeatureClass object: 
[Java] 
AccessWorkspaceFactory accessWorkspaceFactory = new AccessWorkspaceFactory();
Workspace featureWksp = new Workspace(accessWorkspaceFactory.openFromFile(
    "c:/Data/usa/usa.mdb", 0));
FeatureClass fclass = new FeatureClass(featureWksp.openFeatureClass("states"));
Rows, objects, and features 
A RowBuffer is a transient object capable of holding the state of a row but has no object identity. It is used primarily during data loading as the argument to the InsertRow method on an insert cursor. A Row-Buffer is obtained from a table using the CreateRowBuffer method. 
The IRowBuffer interface contains methods to access the state (the set of field values) for a row buffer. These methods take as an argument the numeric index of the field to be accessed. A Row object is an instantiated software object that represents a persistent row in a table. A Row object is normally obtained from a cursor on a table (for example, ICursor.NextRow) or fetched directly given its object ID (for example, ITable.GetRow). See the following illustration showing RowBuffer and Row objects:
 
Once retrieved, clients can query the Row object for additional interfaces and invoke methods on the Row object. The class identifier (CLSID) property of a table determines the type of Row object returned by the table. A new persistent Row object is created using the ITable.CreateRow method. The act of creating the row assigns it identity. 
Use the CreateRow method to create new persistent Row objects, as opposed to directly cocreating the Row objects. The latter will not create a row in the underlying persistent store.
A row has a set of fields. The set of fields for a row is the same as the set of fields for its table. In particular, the numeric index of a field in the Fields collection of its table is the same as the numeric index of the field in the Fields collection of the row, which is the same as the numeric index used to access the value of the field from the row. This means that application programs can and should cache field numeric indexes using the FindField method on the Table object, rather than invoking the FindField method once per row returned by a cursor. 
The following code example shows the creation of a row and an update, followed by the deletion of the row:
[Java] 
Table table = new Table(wksp.openTable("STATES"));
int i = table.findField("STATE_NAME");
wksp.startEditing(false);
wksp.startEditOperation();
Row row = new Row(table.createRow());
br > row.setValue(i, "Exploits");
row.store();
row.setValue(i, "Badger");
row.store();
row.delete();
wksp.stopEditOperation();
wksp.stopEditing(false);
An ObjectClass is a table whose Row objects represent entities. The Row objects handed out by an ObjectClass support the IRow and IObject interface and are referred to as Object objects or Objects). An alternative name for Object object in this context is Entity object. See the following illustration showing RowBuffer, Row, and Object:
 
The IObject interface is almost identical to IRow, from which it inherits. The only additional property is a direct link to the object class.
The instances of an ObjectClass can be partitioned into a number of subtypes. The IRowSubtypes interface on an object contains methods that allow determination and modification of the subtype to which an object belongs and allow initialization or resetting of the field values of an object to the default values defined for its subtype.
When objects are programmatically created via the CreateRow method on the ITable interface (or for features with the CreateFeature method on the IFeatureClass interface), the default subtype is not automatically set, nor are the default values initialized. When using ArcMap, these tasks are automatically performed. However, if you are programmatically creating an object (or feature) that has default values, the following code example indicates the proper sequence that should be followed:
[Java] 
FeatureClass fclass = new FeatureClass(wksp.openFeatureClass("GDB.STATES"));
wksp.startEditing(false);
wksp.startEditOperation();
Feature feature = (Feature)fclass.createFeature();
wksp.stopEditOperation();
wksp.stopEditing(false);
// Get the default subtype code for the feature class.
int defaultSubtype = fclass.getDefaultSubtypeCode();
//Set the subtype and initialize the default values for the feature.
feature.setSubtypeCode(defaultSubtype);
feature.initDefaultValues();
A feature is a spatial object and is a member of a feature class, being a row in the feature class table. A feature has an associated shape, the type of which is defined by the feature class. The shape objects are point, multipoint, multipatch, polyline, and polygon—objects in the Geometry object model. See the following illustration showing RowBuffer, Row, Object, and Feature objects:
 
  评论这张
 
阅读(192)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018