com.esri.arcgis.geodatabase
Interface IFeatureWorkspace

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
IFeatureWorkspaceProxy, Sde3Workspace, Sde4Workspace, VersionedWorkspace, Workspace

public interface IFeatureWorkspace
extends java.io.Serializable

Provides access to members that create and open various types of datasets and other workspace level objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Description

The IFeatureWorkspace interface is used to access and manage datasets that are a key component of a feature based geodatabase; Tables and ObjectClasses, FeatureClasses, FeatureDatasets, and RelationshipClasses. All of the Open methods (such as OpenTable) take a dataset name as input. When working with an enterprise geodatabase, the name may be fully qualified (for example, "database.owner.tablename" or "owner.tablename") using the qualification character appropriate to the underlying database (see ISQLSyntax)). If the input name is not fully qualified, then it is qualified using the currently connected user for the workspace.

When working with geodatabases (personal, file or ArcSDE) the workspace keeps a running object table of instantiated datasets. Multiple calls to open an already instantiated dataset will return a reference to the already instantiated dataset.

When To Use

IFeatureWorkspace is the main interface for creating and opening objects and object classes with a workspace.

IWorkspaceFactory shapeWkspFactory = new ShapefileWorkspaceFactory(); 

IFeatureWorkspace featureWksp = new IFeatureWorkspaceProxy(shapeWkspFactory.openFromFile(aPath, 0)); 


Method Summary
 IFeatureClass createFeatureClass(java.lang.String name, IFields fields, IUID cLSID, IUID eXTCLSID, int featureType, java.lang.String shapeFieldName, java.lang.String configKeyword)
          Creates a new standalone feature class under the workspace.
 IFeatureDataset createFeatureDataset(java.lang.String name, ISpatialReference spatialReference)
          Creates a new feature dataset.
 IQueryDef createQueryDef()
          Create a query definition object.
 IRelationshipClass createRelationshipClass(java.lang.String relClassName, IObjectClass originClass, IObjectClass destinationClass, java.lang.String forwardLabel, java.lang.String backwardLabel, int cardinality, int notification, boolean isComposite, boolean isAttributed, IFields relAttrFields, java.lang.String originPrimaryKey, java.lang.String destPrimaryKey, java.lang.String originForeignKey, java.lang.String destForeignKey)
          Creates a new relationship class.
 ITable createTable(java.lang.String name, IFields fields, IUID cLSID, IUID eXTCLSID, java.lang.String configKeyword)
          Creates a new table.
 IFeatureClass openFeatureClass(java.lang.String name)
          Opens an existing feature class.
 IFeatureDataset openFeatureDataset(java.lang.String name)
          Opens an existing feature dataset.
 IFeatureDataset openFeatureQuery(java.lang.String queryName, IQueryDef pQueryDef)
          Opens a feature dataset containing a single feature class defined by the specified Query.
 IRelationshipClass openRelationshipClass(java.lang.String name)
          Opens an existing relationship class.
 ITable openRelationshipQuery(IRelationshipClass pRelClass, boolean joinForward, IQueryFilter pSrcQueryFilter, ISelectionSet pSrcSelectionSet, java.lang.String targetColumns, boolean doNotPushJoinToDB)
          The table of a relationship join query.
 ITable openTable(java.lang.String name)
          Opens an existing table.
 

Method Detail

openTable

public ITable openTable(java.lang.String name)
                 throws java.io.IOException,
                        AutomationException
Opens an existing table.

Supported Platforms

Windows, Solaris, Linux

Remarks

The OpenTable method can be used to open any existing table or object class in the workspace given its fully qualified name. The table object returned will always support the ITable interface. The returned table object will support additional interfaces depending on the type of table, for example, ObjectClasses will additionally support the IObjectClass interface.
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 table.  Use the NameExists method on the IWorkspace2 interface to determine if a table with the appropriate name exists in the geodatabase.
Some examples of how to use the name parameter of OpenTable are shown below:

For Coverage feature classes:
cover:feature("stream:arc")
For info tables:
cover:feature("stream.aat")
For Oracle tables:
gdb.Owners
For SQLServer tables:
fdo_data.gdb.Owners
For Informix tables:
bladetest2:gdb.Owners
The 4 tables associated with a Topology; T_#_DirtyAreas, T_#_PolyErrors, T_#_LineErrors and T_#_PointErrors cannot be directly edited. For this reason they cannot be opened and will fail with a general Geodatabase error.

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDatabaseConnectionInfo

createTable

public ITable createTable(java.lang.String name,
                          IFields fields,
                          IUID cLSID,
                          IUID eXTCLSID,
                          java.lang.String configKeyword)
                   throws java.io.IOException,
                          AutomationException
Creates a new table.

Supported Platforms

Windows, Solaris, Linux

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 aggregates esriGeoDatabase.Object. CLSID must be set if EXTCLSID is set.

The optional configurationKeyword parameter 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, the list of available keywords supported by a workspace may be obtained using the IWorkspaceConfiguration interface. For more information on configuration keywords, refer to the ArcSDE documentation.

Note: Do not prefixed table or feature class names with the following:

"gdb_"

"sde_"

"delta_"

 

Parameters:
name - The name (in)
fields - A reference to a com.esri.arcgis.geodatabase.IFields (in)
cLSID - A reference to a com.esri.arcgis.system.IUID (in)
eXTCLSID - A reference to a com.esri.arcgis.system.IUID (in)
configKeyword - The configKeyword (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openFeatureClass

public IFeatureClass openFeatureClass(java.lang.String name)
                               throws java.io.IOException,
                                      AutomationException
Opens an existing feature class.

Supported Platforms

Windows, Solaris, Linux

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 FeatureClasses that are part of a FeatureDataset (the FeatureDataset 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 the 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.

Some examples of how to use the name parameter of OpenFeatureClass are shown below:

For Coverage feature classes:
buildings:polygon
For Oracle feature classes (the owner prefix is unnecessary if you are connected as the owner of the feature class):
gdb.Buildings
For SQLServer feature classes:
fdo_data.gdb.Buildings
For Informix feature classes:
bladetest2:gdb.Buildings
For VPF feature classes:
ks032193:veg:vgfarea (library:coverage:feature class)
The library name for VPF data is case sensitive and must appear as it is stored in the LAT (Library Attribute Table)
The 4 tables associated with a Topology; T_#_DirtyAreas, T_#_PolyErrors, T_#_LineErrors and T_#_PointErrors cannot be directly edited. For this reason they cannot be opened and will fail with a general Geodatabase error.

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDatabaseConnectionInfo

createFeatureClass

public IFeatureClass createFeatureClass(java.lang.String name,
                                        IFields fields,
                                        IUID cLSID,
                                        IUID eXTCLSID,
                                        int featureType,
                                        java.lang.String shapeFieldName,
                                        java.lang.String configKeyword)
                                 throws java.io.IOException,
                                        AutomationException
Creates a new standalone feature class under the workspace.

Supported Platforms

Windows, Solaris, Linux

Remarks

The CreateFeatureClass method can be used to create a stand-alone feature class that is not part of a FeatureDataset. It takes, in addition to all the parameters that CreateTable takes, a FeatureType parameter that specifies the category of features to be stored in this feature class (such as esriFTSimple, esriFTComplexEdgeFeature, and others) and a shapeFieldName. The ShapeFieldName identifies the name of the field in the input fields collection, of type Geometry, that represents the shape field for the feature class. The GeometryDef object associated with the shape Field object must be fully setup with information on both the spatial reference (the projected or geographic coordinate system plus the vertical coordinate system if needed, the coordinate domain and the coordinate resolution), and the spatial index for the shape Field before calling CreateFeatureClass.

If the FeatureWorkspace the FeatureClass is being created in is a Geodatabase workspace then at a minimum the Fields object must contain the required fields. 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 optional CLSID parameter is used to specify what GUID to use to instantiate the object representing a feature in that FeatureClass. If "Nothing" is passed in for the CLSID, the GeoDatabase will use the CLSID corresponding to esriGeoDatabase.Feature. This is OK in most instances. If you know the FeatureClass has a custom Feature other than esriGeoDatabase.Feature, you can pass in its GUID at this time or later call methods on the FeatureClass' IClassSchemaEdit interface.

The optional EXTCLSID parameter specifies the GUID to use to instantiate the object representing the FeatureClassExtension. This object must at least support the IClassExtension interface. If you pass in "Nothing" for the EXTCLSID, the newly created FeatureClass will not have a ClassExtension. Since ClassExtensions are not required, this is generally OK, unless the FeatureClass is for annotationdimension lines or a custom FeatureClass that requires a ClassExtension. If you know the FeatureClass has a ClassExtension and you know the GUID for the ClassExtension, you can pass it in at this time or later call methods on the FeatureClass's IClassSchemaEdit interface.

The optional configurationKeyword parameter 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 configurationKeywords 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. For more information on configuration keywords, refer to the ArcSDE documentation.

If the workspace the FeatureClass 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 FeatureClass.  Use the IGeodatabaseRelease interface to determine the release of the geodatabase

Note: Do not table or feature class names with the following prefixes are not supported:

Parameters:
name - The name (in)
fields - A reference to a com.esri.arcgis.geodatabase.IFields (in)
cLSID - A reference to a com.esri.arcgis.system.IUID (in)
eXTCLSID - A reference to a com.esri.arcgis.system.IUID (in)
featureType - A com.esri.arcgis.geodatabase.esriFeatureType constant (in)
shapeFieldName - The shapeFieldName (in)
configKeyword - The configKeyword (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openFeatureDataset

public IFeatureDataset openFeatureDataset(java.lang.String name)
                                   throws java.io.IOException,
                                          AutomationException
Opens an existing feature dataset.

Supported Platforms

Windows, Solaris, Linux

Remarks

The OpenFeatureDataset method can be used to open any existing feature dataset in the workspace given its fully qualified name. At ArcGIS release 8.1 and higher, opening a feature dataset does not automatically instantiate all the feature classes in the feature dataset.

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.

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureDataset
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDatabaseConnectionInfo

createFeatureDataset

public IFeatureDataset createFeatureDataset(java.lang.String name,
                                            ISpatialReference spatialReference)
                                     throws java.io.IOException,
                                            AutomationException
Creates a new feature dataset.

Supported Platforms

Windows, Solaris, Linux

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

Parameters:
name - The name (in)
spatialReference - A reference to a com.esri.arcgis.geometry.ISpatialReference (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureDataset
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createQueryDef

public IQueryDef createQueryDef()
                         throws java.io.IOException,
                                AutomationException
Create a query definition object.

Supported Platforms

Windows, Solaris, Linux

Remarks

The CreateQueryDef method can be used to create a new query definition object that can be evaluated by returning a cursor.

Returns:
A reference to a com.esri.arcgis.geodatabase.IQueryDef
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openFeatureQuery

public IFeatureDataset openFeatureQuery(java.lang.String queryName,
                                        IQueryDef pQueryDef)
                                 throws java.io.IOException,
                                        AutomationException
Opens a feature dataset containing a single feature class defined by the specified Query.

Supported Platforms

Windows, Solaris, Linux

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 Map. The shape column is required as part of the SubFields parameter of the QueryDef.

Parameters:
queryName - The queryName (in)
pQueryDef - A reference to a com.esri.arcgis.geodatabase.IQueryDef (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureDataset
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openRelationshipClass

public IRelationshipClass openRelationshipClass(java.lang.String name)
                                         throws java.io.IOException,
                                                AutomationException
Opens an existing relationship class.

Supported Platforms

Windows, Solaris, Linux

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.

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IRelationshipClass
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IDatabaseConnectionInfo

createRelationshipClass

public IRelationshipClass createRelationshipClass(java.lang.String relClassName,
                                                  IObjectClass originClass,
                                                  IObjectClass destinationClass,
                                                  java.lang.String forwardLabel,
                                                  java.lang.String backwardLabel,
                                                  int cardinality,
                                                  int notification,
                                                  boolean isComposite,
                                                  boolean isAttributed,
                                                  IFields relAttrFields,
                                                  java.lang.String originPrimaryKey,
                                                  java.lang.String destPrimaryKey,
                                                  java.lang.String originForeignKey,
                                                  java.lang.String destForeignKey)
                                           throws java.io.IOException,
                                                  AutomationException
Creates a new relationship class.

Supported Platforms

Windows, Solaris, Linux

Remarks

The CreateRelationshipClass method can be used to create a new stand-alone relationship class that is not part of a FeatureDataset. 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, a value of 0 or Nothing 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 DestinationPrimaryKey are the primary key fields for the origin and destination object classes. OriginForeignKey and the DestinationForeignKey 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 DestinationPrimaryKey must be supplied.

Parameters:
relClassName - The relClassName (in)
originClass - A reference to a com.esri.arcgis.geodatabase.IObjectClass (in)
destinationClass - A reference to a com.esri.arcgis.geodatabase.IObjectClass (in)
forwardLabel - The forwardLabel (in)
backwardLabel - The backwardLabel (in)
cardinality - A com.esri.arcgis.geodatabase.esriRelCardinality constant (in)
notification - A com.esri.arcgis.geodatabase.esriRelNotification constant (in)
isComposite - The isComposite (in)
isAttributed - The isAttributed (in)
relAttrFields - A reference to a com.esri.arcgis.geodatabase.IFields (in)
originPrimaryKey - The originPrimaryKey (in)
destPrimaryKey - The destPrimaryKey (in)
originForeignKey - The originForeignKey (in)
destForeignKey - The destForeignKey (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IRelationshipClass
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openRelationshipQuery

public ITable openRelationshipQuery(IRelationshipClass pRelClass,
                                    boolean joinForward,
                                    IQueryFilter pSrcQueryFilter,
                                    ISelectionSet pSrcSelectionSet,
                                    java.lang.String targetColumns,
                                    boolean doNotPushJoinToDB)
                             throws java.io.IOException,
                                    AutomationException
The table of a relationship join query.

Supported Platforms

Windows, Solaris, Linux

Parameters:
pRelClass - A reference to a com.esri.arcgis.geodatabase.IRelationshipClass (in)
joinForward - The joinForward (in)
pSrcQueryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
pSrcSelectionSet - A reference to a com.esri.arcgis.geodatabase.ISelectionSet (in)
targetColumns - The targetColumns (in)
doNotPushJoinToDB - The doNotPushJoinToDB (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.