数据集属性

摘要

Describe 函数将返回数据集的以下属性。

各种类型的 Describe 对象中均存在数据集属性。

属性

属性说明数据类型
canVersion
(只读)

Indicates whether the dataset can be versioned

Boolean
datasetType
(只读)

Returns the type of dataset being described

  • Any
  • Container
  • Geo
  • FeatureDataset
  • FeatureClass
  • PlanarGraph
  • GeometricNetwork
  • Topology
  • Text
  • Table
  • RelationshipClass
  • RasterDataset
  • RasterBand
  • TIN
  • CadDrawing
  • RasterCatalog
  • Toolbox
  • Tool
  • NetworkDataset
  • Terrain
  • RepresentationClass
  • CadastralFabric
  • SchematicDataset
  • Locator
String
DSID
(只读)

The ID of the dataset

Integer
extent
(只读)

The Extent object

Extent
isVersioned
(只读)

Indicates whether the dataset is versioned

Boolean
MExtent
(只读)

A space-delimited string (MMin MMax)

String
spatialReference
(只读)

Returns the SpatialReference object for the dataset

SpatialReference
ZExtent
(只读)

A space-delimited string (ZMin ZMax)

String

代码示例

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))

7/10/2012