Workspace properties

Zusammenfassung

The Describe function returns the properties described below for a workspace.

For a workspace, the Describe dataType property returns a value of "Workspace".

Eigenschaften

EigenschaftErläuterungDatentyp
connectionProperties
(Schreibgeschützt)

The connection properties for an enterprise geodatabase workspace will vary depending on the type of enterprise database being used. connectionProperties is a property set. Possible properties include the following:

  • authentication_mode—The credential authentication mode of the connection, either OSA or DBMS.
  • database—The database the workspace is connected to.
  • dbClient—The database client, for example, sqlserver, db2, oracle, or postgresql.
  • historical_name—The historical marker name of the historical version the workspace is connected to.
  • historical_timestamp—A date and time that represents a time stamp moment in the historical version the workspace is connected to.
  • is_geodatabase—Returns true if the database has been enabled to support a geodatabase; otherwise, it returns false. The is_geodatabase value is returned as a string.
  • instance—The instance the workspace is connected to.
  • server—The enterprise server name the workspace is connected to.
  • user—The connected user.
  • version—The name of the transactional version the workspace is connected to.
  • branch—The name of the branch version the workspace is connected to.

Only one historical_name, historical_timestamp, version, or branch value exists for any given workspace.

Object
connectionString
(Schreibgeschützt)

The connection string that is used in conjunction with the enterprise database type. For any other workspace type, an empty string is returned.

String
currentRelease
(Schreibgeschützt)

For a geodatabase workspace, specifies whether the geodatabase's version is current. This property can be used to assess whether the geodatabase can be upgraded.

Boolean
domains
(Schreibgeschützt)

A list containing the geodatabase domain names. To work with these domain names, use tools in the Domains toolset.

String
release
(Schreibgeschützt)

For a geodatabase workspace, returns the geodatabase release value. The following table shows the mapping of geodatabase release values to ArcGIS version numbers:

Geodatabase release valueArcGIS version

2,2,0

9.2

2,3,0

9.3, 9.3.1

3,0,0

10.0–10.8.1

ArcGIS Pro 1.0–3.3

String
supportsBigInteger
(Schreibgeschützt)

Specifies whether the workspace supports Big Integer type fields.

Boolean
supportsBigObjectID
(Schreibgeschützt)

Specifies whether the workspace supports objects with a 64-bit object ID.

Boolean
supportsDateOnly
(Schreibgeschützt)

Specifies whether the workspace supports fields of type Date Only.

Boolean
supportsTimeOnly
(Schreibgeschützt)

Specifies whether the workspace supports fields of type Time Only.

Boolean
supportsTimestampOffset
(Schreibgeschützt)

Specifies whether the workspace supports fields of type Timestamp Offset.

Boolean
workspaceFactoryProgID
(Schreibgeschützt)

The ID is a string that you can use to distinguish between workspace types with a finer granularity than you can with workspaceType.

The following are workspaceFactoryProgID values returned for common workspace types:

  • esriDataSourcesGDB.AccessWorkspaceFactoryThe ID indicates a personal geodatabase.
  • esriDataSourcesGDB.FileGDBWorkspaceFactoryThe ID indicates a file geodatabase.
  • esriDataSourcesGDB.InMemoryWorkspaceFactoryThe ID indicates an in-memory workspace.
  • esriDataSourcesGDB.MemoryWorkspaceFactoryThe ID indicates a memory workspace.
  • esriDataSourcesGDB.SdeWorkspaceFactoryThe ID indicates an enterprise geodatabase.
  • esriDataSourcesGDB.SqliteWorkspaceFactoryThe ID indicates a mobile geodatabase.
  • (empty string)An empty string indicates another workspace type.
Vorversion:

Prior to ArcGIS Pro 3.0, a memory workspace would return a value of esriDataSourcesGDB.ColumnaDBWorkspaceFactory.

Tipp:

In 32-bit products, a .1 follows the string returned by workspaceFactoryProgID. When writing code that will be used with 32-bit and 64-bit products, use the startswith string method.

describe = arcpy.Describe(data)
# Not - if describe.workspaceFactoryProgID == 'esriDataSourcesGDB.FileGDBWorkspaceFactory.1'
if describe.workspaceFactoryProgID.startswith('esriDataSourcesGDB.FileGDBWorkspaceFactory'):
    continue
String
workspaceType
(Schreibgeschützt)

Specifies the workspace type.

  • FileSystemThe workspace type is a file-based workspace (shapefile, coverage, and so on) or an in-memory workspace.
  • LocalDatabaseThe workspace type is a local geodatabase (a file or personal geodatabase) or a memory workspace.
  • RemoteDatabaseThe workspace type is a geodatabase that requires a remote connection (enterprise, OLE DB, and so on).
String

Codebeispiel

Workspace properties example

The following stand-alone script displays workspace properties for an enterprise database:

import arcpy

# Create a Describe object for an Enterprise database
desc = arcpy.Describe(r"c:\data\Connection to state.sde")

print(f"Connection string:       {desc.connectionString}")
print(f"WorkspaceFactoryProgID:  {desc.workspaceFactoryProgID}")
print(f"Workspace type:          {desc.workspaceType}")

# Print connection properties
cp = desc.connectionProperties
print("\nDatabase Connection Properties:")
print(f"  Server:          {cp.server}")
print(f"  Instance:        {cp.instance}")
print(f"  Database:        {cp.database}")
print(f"  Database client: {cp.dbClient}")
print(f"  User:            {cp.user}")
print(f"  Version:         {cp.version}")

# Print workspace domain names
domains = desc.domains
print("\nDomains:")
for domain in domains:
    print(f"  {domain}")