Interface IFeatureWorkspace
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that create and open various types of datasets and other workspace level objects.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("D9CAB491-3F69-11D1-B095-0000F8780820")]
public interface IFeatureWorkspace
Methods
CreateFeatureClass(string, IFields, UID, UID, esriFeatureType, string, string)
Creates a new standalone feature class under the workspace.
IFeatureClass CreateFeatureClass(string Name, IFields Fields, UID CLSID, UID EXTCLSID, esriFeatureType FeatureType, string ShapeFieldName, string ConfigKeyword)
Parameters
NamestringFieldsIFieldsCLSIDUIDEXTCLSIDUIDFeatureTypeesriFeatureTypeShapeFieldNamestringConfigKeywordstring
Returns
Remarks
The CreateFeatureClass method can be used to create a stand-alone feature class that is not part of a feature dataset. It takes, in addition to all the parameters that CreateTable takes, an esriFeatureType parameter that specifies the category of features to be stored in this feature class (i.e., esriFTSimple, esriFTComplexEdgeFeature) and a shape field name. The shape field name identifies the name of the field in the input fields collection that represents the shape field for the feature class.
The Fields object passed to the Fields parameter should not be an object retrieved from another class. If the new class is going to have the same fields as an existing class, cast the existing class' fields collection to the IClone interface, clone it, and use the cloned fields collection as input for this method.
The GeometryDef object associated with the shape field object must be fully setup with a spatial reference, grid properties, and the geometry type before calling CreateFeatureClass.
The following esriGeometryType enumeration values represent the valid geometry types for a new feature class' GeometryDef object: esriGeometryPoint, esriGeometryMultipoint, esriGeometryPolyline, esriGeometryPolygon, and esriGeometryMultiPatch.
If the feature class is being created in geodatabase then the fields collection must contain, at a minimum, an Object ID field and a Shape field. The required fields can be obtained from the class description for the type of object you wish to create (see the RequiredFields property on IObjectClassDescription).
The CLSID parameter is used to specify what type of feature will be contained by the class. If a null value is passed in for the CLSID, the geodatabase will return Feature instances from the class. In most cases, this is the desired behavior. If the feature class is used to store custom features, the GUID of the custom feature should be provided. Alternatively, the IClassSchemaEdit interface can be used to change the feature class' CLSID following creation.
The EXTCLSID parameter is used to specify what class will be instantiated as the feature class extension. This object must at least support the IClassExtension interface. If a null value is passed in for the EXTCLSID parameter, the feature class will not have a class extension associated with it. Since class extensions are not required, this is often the desired behavior. If the feature class should have an associated extension, the GUID of the class extension should be provided. Alternatively, the IClassSchemaEdit interface can be used to associate a class extension following creation.
The configurationKeywordparameter allows the application to control the physical layout for this table in the underlying RDBMS. For example, in the case of an Oracle database, the configuration keyword controls the tablespace in which the table is created, the initial and next extents, and other properties. The configuration keywords for an ArcSDE instance are set up by the ArcSDE data administrator, and the list of available keywords supported by a workspace may be obtained using the IWorkspaceConfigurationinterface.
If the workspace the feature class will be created in is a pre-9.2 geodatabase, you must ensure the GeometryDef references a low precision spatial reference. 9.1 and earlier versions of the geodatabase only support low precision spatial references, while 9.2 geodatabases require high precision spatial references. Use IControlPrecision2::IsHighPrecision to manage the precision level of the spatial reference used to create the feature class. Use the IGeodatabaseRelease interface to determine the release of the geodatabase.
Developers should be aware that calling this method on a shapefile workspace when a shapefile of the same name already exists will cause the existing shapefile to be deleted. To prevent this, check for the existence of a shapefile prior to calling this method.
Note:Table or feature class names with the following prefixes are not supported:
~ "gdb_"
~ "sde_"
~ "delta_"
CreateFeatureDataset(string, ISpatialReference)
Creates a new feature dataset.
IFeatureDataset CreateFeatureDataset(string Name, ISpatialReference SpatialReference)
Parameters
NamestringSpatialReferenceISpatialReference
Returns
Remarks
The CreateFeatureDataset method can be used to create a new FeatureDataset given its name and spatial reference. Methods supported by the returned feature dataset allow creation of feature classes in the feature dataset.
If the workspace the FeatureDataset will be created in is a pre-9.2 Geodatabase, you must ensure the spatial reference is a low precision spatial reference. 9.1 and earlier versions of the Geodatabase only support low precision spatial references, while 9.2 Geodatabases require high precision spatial references. Use IControlPrecision2::IsHighPrecision to manage the precision level of the spatial reference used to create the FeatureDataset. Use the IGeodatabaseRelease interface to determine the release of the geodatabase
CreateQueryDef()
Create a query definition object.
IQueryDef CreateQueryDef()
Returns
Remarks
The CreateQueryDef method can be used to create a new query definition object that can be evaluated by returning a cursor.
With personal geodatabases, QueryDefs do not return newly inserted rows, within an edit session when the QueryDef contains a Where Clause. The edits must be saved and the QueryDef executed outside of the edit session or Search must be used to return the information.
CreateRelationshipClass(string, IObjectClass, IObjectClass, string, string, esriRelCardinality, esriRelNotification, bool, bool, IFields, string, string, string, string)
Creates a new relationship class.
IRelationshipClass CreateRelationshipClass(string relClassName, IObjectClass OriginClass, IObjectClass DestinationClass, string ForwardLabel, string BackwardLabel, esriRelCardinality Cardinality, esriRelNotification Notification, bool IsComposite, bool IsAttributed, IFields relAttrFields, string OriginPrimaryKey, string destPrimaryKey, string OriginForeignKey, string destForeignKey)
Parameters
relClassNamestringOriginClassIObjectClassDestinationClassIObjectClassForwardLabelstringBackwardLabelstringCardinalityesriRelCardinalityNotificationesriRelNotificationIsCompositeboolIsAttributedboolrelAttrFieldsIFieldsOriginPrimaryKeystringdestPrimaryKeystringOriginForeignKeystringdestForeignKeystring
Returns
Remarks
The CreateRelationshipClass method can be used to create a new stand-alone relationship class that is not part of a feature dataset. The relationship class is implemented as a separate data table whose name is the name of the relationship class if the cardinality is many-to-many or if the relationship class is attributed. The relAttribFields parameter is optional, and a null value may be passed in for non-attributed relationship classes.
Many-to-many or attributed relationship classes require specification of all four key fields—the OriginPrimaryKey and the destPrimaryKey parameters are the primary key fields for the origin and destination object classes. The OriginForeignKey and destForeignKey parameters are the names of the corresponding foreign keys that will be created in the data table representing the relationship class. If the relationship class is one-to-one or one-to-many and not attributed, then the relationship class is implemented as a foreign key field in the destination object class (the OriginForeignKey) that references the primary key field in the origin object class (the OriginPrimaryKey). In this case, the OriginPrimaryKey, the OriginForeignKey, and the destPrimaryKey must be supplied.
The Fields object passed to the relAttrFields parameter should not be an object retrieved from another class. If the new class is going to have the same fields as an existing class, cast the existing class' fields collection to the IClone interface, clone it, and use the cloned fields collection as input for this method.
CreateTable(string, IFields, UID, UID, string)
Creates a new table.
ITable CreateTable(string Name, IFields Fields, UID CLSID, UID EXTCLSID, string ConfigKeyword)
Parameters
Returns
Remarks
The CreateTable method can be used to create a new table or object class in the workspace.
The optional CLSID and EXTCLSID parameters allow the calling application to specify the GUIDs for the objects that implement the instance and the class extension behavior for an object class. If no CLSID is passed in, then the resulting table is not registered in the geodatabase object class data dictionary (It will support the IObjectClass interface but will have an ObjectClassID of –1). Valid values for CLSID are esriGeoDatabase.Object or any non-spatial object that extends esriGeoDatabase.Object. CLSID must be set in order to apply a class extension with the EXTCLSID parameter.
The Fields object passed to the Fields parameter should not be an object retrieved from another class. If the new class is going to have the same fields as an existing class, cast the existing class' fields collection to the IClone interface, clone it, and use the cloned fields collection as input for this method.
The optional configurationKeyword parameter allows the application to control the physical layout for this table in the underlying RDBMS. For example, in an Oracle database, the configuration keyword controls the tablespace in which the table is created, the initial and next extents, and other properties. The configuration keywords for an ArcSDE instance are set up by the ArcSDE data administrator, the list of available keywords supported by a workspace may be obtained using the IWorkspaceConfiguration interface.
Note: Table or feature class names with the following prefixes are not supported:
- "gdb_"
- "sde_"
- "delta_"
OpenExtensionDataset(esriDatasetType, string)
Opens an existing extension dataset.
IDataset OpenExtensionDataset(esriDatasetType extensionDatasetType, string extensionDatasetName)
Parameters
extensionDatasetTypeesriDatasetTypeextensionDatasetNamestring
Returns
OpenFeatureClass(string)
Opens an existing feature class.
IFeatureClass OpenFeatureClass(string Name)
Parameters
Namestring
Returns
Remarks
The OpenFeatureClass method can be used to open any existing feature class in the workspace given its fully qualified name. Note that every feature class in a geodatabase has a unique fully qualified name, and the OpenFeatureClass method can be used to directly open feature classes that are part of a feature dataset (the feature dataset name does not need to be specified).
Use the IDatabaseConnectionInfo interface to determine the User and Database (if applicable). ISQLSyntax::QualifyTableName can be used to determine the fully qualified name for a feature class. Use the NameExists method on the IWorkspace2 interface to determine if a feature class with the appropriate name exists in a geodatabase.
Opening a feature class that participates in a topology or geometric network will also open all other feature classes participating in the topology or geometric network in memory.
For Coverage feature classes:
buildings:polygon
gdb.Buildings
OpenFeatureDataset(string)
Opens an existing feature dataset.
IFeatureDataset OpenFeatureDataset(string Name)
Parameters
Namestring
Returns
Remarks
The OpenFeatureDataset method can be used to open any existing feature dataset in the workspace given its fully qualified name.
Use the IDatabaseConnectionInfo interface to determine the User and Database (if applicable). ISQLSyntax::QualifyTableName can be used to determine the fully qualified name for a feature dataset.
OpenFeatureQuery(string, IQueryDef)
Opens a feature dataset containing a single feature class defined by the specified Query.
IFeatureDataset OpenFeatureQuery(string QueryName, IQueryDef QueryDef)
Parameters
Returns
Remarks
The OpenFeatureQuery can be used to open a virtual feature class whose definition is based on a QueryDef created using the CreateQueryDef method. The QueryDef can involve multiple tables as long as one of them is a feature class; the resulting virtual feature class can be used to construct a feature layer that can be added to a map. The shape column is required as part of the SubFields parameter of the QueryDef.
OpenRelationshipClass(string)
Opens an existing relationship class.
IRelationshipClass OpenRelationshipClass(string Name)
Parameters
Namestring
Returns
Remarks
The OpenRelationshipClass method can be used to open any existing relationship class in the workspace given its fully qualified name.
Use the IDatabaseConnectionInfo interface to determine the User and Database (if applicable). ISQLSyntax::QualifyTableName can be used to determine the fully qualified name for a relationship class.
OpenRelationshipQuery(IRelationshipClass, bool, IQueryFilter, ISelectionSet, string, bool)
The table of a relationship join query.
ITable OpenRelationshipQuery(IRelationshipClass relClass, bool joinForward, IQueryFilter SrcQueryFilter, ISelectionSet SrcSelectionSet, string TargetColumns, bool DoNotPushJoinToDB)
Parameters
relClassIRelationshipClassjoinForwardboolSrcQueryFilterIQueryFilterSrcSelectionSetISelectionSetTargetColumnsstringDoNotPushJoinToDBbool
Returns
OpenTable(string)
Opens an existing table.
ITable OpenTable(string Name)
Parameters
Namestring
Returns
Remarks
For Coverage feature classes:
cover:feature("stream:arc")
cover:feature("stream.aat")
gdb.Owners