Propiedades del espacio de trabajo

Resumen

La función Describir devuelve las siguientes propiedades para los Espacios de trabajo.

Un espacio de trabajo devuelve un tipo de datos de "Espacio de trabajo".

Propiedades

PropiedadExplicaciónTipo de datos
connectionProperties
(Sólo lectura)

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

Object
connectionString
(Sólo lectura)

The connection string being used in conjunction with the SDE database type. For other workspace types, this string is always empty.

String
domains
(Sólo lectura)

A Python List containing the geodatabase domain names. To work with these domain names, you can use tools from the Domains_toolset.

String
workspaceFactoryProgID
(Sólo lectura)

The ID as a string. You can use this to distinguish between specific workspace types with a finer granularity than you can with workspaceType. For example, workspaceFactoryProgID can distinguish between a file geodatabase and a personal geodatabase. Using workspaceType, you cannot make that distinction.

Following are workspaceFactoryProgID strings returned for the common workspace types:

  • esriDataSourcesGDB.FileGDBWorkspaceFactory.1File geodatabase
  • esriDataSourcesGDB.AccessWorkspaceFactory.1Personal geodatabase
  • esriDataSourcesGDB.SdeWorkspaceFactory.1SDE geodatabase
  • (empty string)Other (Shapefile, coverage, CAD, VPF, and so on).
String
workspaceType
(Sólo lectura)

The workspace type.

  • FileSystemFile-based workspaces (coverages, shapefiles and so forth).
  • LocalDatabaseGeodatabases that are local (a file or personal geodatabase).
  • RemoteDatabaseGeodatabases that require a remote connection (ArcSDE, OLE DB, and so forth)
String

Ejemplo de código

Workspace properties example (stand-alone script)

The following stand-alone script displays some workspace properties for an SDE database.

import arcpy

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

# Print workspace properties
#
print "%-24s %s" % ("Connection String:", desc.connectionString)
print "%-24s %s" % ("WorkspaceFactoryProgID:", desc.workspaceFactoryProgID)
print "%-24s %s" % ("Workspace Type:", desc.workspaceType)

# Print Connection properties
#
cp = desc.connectionProperties
print "\nDatabase Connection Properties:"
print "%-12s %s" % ("  Server:", cp.server)
print "%-12s %s" % ("  Instance:", cp.instance)
print "%-12s %s" % ("  Database:", cp.database)
print "%-12s %s" % ("  User:", cp.user)
print "%-12s %s" % ("  Version:", cp.version)

# Print workspace domain names"
#
domains = desc.domains
print "\nDomains:"
for domain in domains:
    print "\t" + domain



7/10/2012