Dataset properties (arcpy)
Zusammenfassung
The Describe function returns the following properties for Datasets.
Dataset properties are available in many types of Describe objects.
Eigenschaften
Eigenschaft | Erläuterung | Datentyp |
canVersion (Schreibgeschützt) |
Indicates whether the dataset can be versioned | Boolean |
datasetType (Schreibgeschützt) |
Returns the type of dataset being described
| String |
DSID (Schreibgeschützt) |
The ID of the dataset | Integer |
extent (Schreibgeschützt) |
The Extent object | Extent |
isVersioned (Schreibgeschützt) |
Indicates whether the dataset is versioned | Boolean |
MExtent (Schreibgeschützt) |
A space-delimited string (MMin MMax) | String |
spatialReference (Schreibgeschützt) |
Returns the SpatialReference object for the dataset | SpatialReference |
ZExtent (Schreibgeschützt) |
A space-delimited string (ZMin ZMax) | String |
Codebeispiel
Dataset properties example (stand-alone script)
The following stand-alone script displays some dataset properties for a shapefile.
import arcpy
# Create a Describe object from the shapefile
#
desc = arcpy.Describe("C:/temp/xy.shp")
# Print dataset properties
#
print("Dataset Type: {0}".format(desc.datasetType))
print("Extent:\n XMin: {0}, XMax: {1}, YMin: {2}, YMax: {3}".format(
desc.extent.XMin, desc.extent.XMax, desc.extent.YMin, desc.extent.YMax))
print("MExtent: {0}".format(desc.MExtent))
print("ZExtent: {0}".format(desc.ZExtent))
print("Spatial reference name: {0}:".format(desc.spatialReference.name))
9/11/2013