arcpy 实现列举目录下的要素类与描述矢量数据要素类

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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值