>>> import arcpy#导入arcpy包
... arcpy.env.workspace=ur'F:\arcpy_data\钦州市'#设置好工作空间
... fcs=arcpy.ListFeatureClasses()#使用列举要素类的函数ListFeatureClass()
... for fc in fcs:
... print fc,#使用for循环打印出来。
... print (fc)
...
BeibuGulfUniversity.shp POI_tmp.shp traffic_a_free_1.shp traffic_free_1.shp transport_free_1.shp water_a_free_1.shp 公路.shp 兴趣点.shp 区界.shp 区界线.shp 县界.shp 土地利用.shp 地名.shp 建筑.shp 水路.shp 著名地点.shp 钦北区.shp 钦南区.shp 铁路.shp 铁路.shp
>>>
import arcpy #导入arcpy包
... arcpy.env.Workspace=r'F:\arcpy_data\钦州市'#设置工作空间
... desc=arcpy.Describe(r'兴趣点.shp')#使用describe对要素类描述
... print (desc.dataType)#使用datatype获取数据类型
... print desc.shapeType#使用shapetype获取形状类型
... ext=desc.extent#使用extent获取要素的范围
... print ext.XMin,ext.XMax,ext.YMin,ext.YMax,#打印左右上下四个空间范围
... sr=desc.spatialReference#使用spatialreference获取空间参考
... print sr.type,sr.name#打印空间参考的类型和名称。
输出结果:
ShapeFile
Point
36573596.8449 36594287.454 2381794.3559 2420697.0862
Projected CGCS2000_3_Degree_GK_Zone_36