Describe object properties (arcpy)
Zusammenfassung
The Describe function returns the following properties for all Describe objects.
Eigenschaften
Eigenschaft | Erläuterung | Datentyp |
baseName (Schreibgeschützt) |
The file base name | String |
catalogPath (Schreibgeschützt) |
The path of the data | String |
children (Schreibgeschützt) |
A list of sub elements | Describe |
childrenExpanded (Schreibgeschützt) |
Indicates whether the children have been expanded | Boolean |
dataElementType (Schreibgeschützt) |
The element type of the element | String |
dataType (Schreibgeschützt) |
The type of the element | String |
extension (Schreibgeschützt) |
The file extension | String |
file (Schreibgeschützt) |
The file name | String |
fullPropsRetrieved (Schreibgeschützt) |
Indicates whether full properties have been retrieved | Boolean |
metadataRetrieved (Schreibgeschützt) |
Indicates whether the metadata has been retrieved | Boolean |
name (Schreibgeschützt) |
The user-assigned name for the element | String |
path (Schreibgeschützt) |
The file path | String |
Codebeispiel
Describe object properties example (stand-alone script)
Display some Describe object properties for a file geodatabase.
import arcpy
# Create a Describe object
#
desc = arcpy.Describe("C:/Data/chesapeake.gdb")
# Print some Describe Object properties
#
if hasattr(desc, "name"):
print "Name: " + desc.name
if hasattr(desc, "dataType"):
print "DataType: " + desc.dataType
if hasattr(desc, "catalogPath"):
print "CatalogPath: " + desc.catalogPath
# Examine children and print their name and dataType
#
print "Children:"
for child in desc.children:
print "\t%s = %s" % (child.name, child.dataType)
9/11/2013