ArcPy列举字段
2017-01-11 15:56
232 查看
#列举字段
file_names=('BOUAN','BOULK','BOUNT','BOUPT','CTRLK','CTRPT','HYDAN','HYDLK','HYDNT','HYDPT','PIPAN','PIPLK','PIPNT','PIPPT','RESAN','RESLK','RESNT','RESPT','ROAAN','ROALK','ROANT','ROAPT','TERAN','TERLK','TERNT','TERPT','VEGAN','VEGLK','VEGNT','VEGPT')
... arcpy.env.workspace=r'Database Connections/Connection to Orcl.sde'
... workspace = arcpy.env.workspace
... sde_datasets = arcpy.ListDatasets()
... for sde_dataset in sde_datasets:
... sde_ds_names = sde_dataset.split('.')
... sde_ds_user = sde_ds_names[0]
... if sde_ds_user=='GYJCCH':
... for sde_fc in arcpy.ListFeatureClasses(feature_dataset=sde_dataset):
... sde_fc_names = os.path.split(sde_fc)
... sde_fc_fullnames = sde_fc_names[1].split('.')
... sde_fc_name = sde_fc_fullnames[1]
... sde_fc_shortname = sde_fc_name[-5:]
... if sde_fc_shortname in file_names and sde_fc_name[0:10]=='DLG_K_C80_':
... sde_fc_fields = arcpy.ListFields(sde_fc)
... for sde_fc_field in sde_fc_fields:
... print ('field name {0} with type {1} and length {2}'.format(sde_fc_field.name,sde_fc_field.type,sde_fc_field.length))
file_names=('BOUAN','BOULK','BOUNT','BOUPT','CTRLK','CTRPT','HYDAN','HYDLK','HYDNT','HYDPT','PIPAN','PIPLK','PIPNT','PIPPT','RESAN','RESLK','RESNT','RESPT','ROAAN','ROALK','ROANT','ROAPT','TERAN','TERLK','TERNT','TERPT','VEGAN','VEGLK','VEGNT','VEGPT')
... arcpy.env.workspace=r'Database Connections/Connection to Orcl.sde'
... workspace = arcpy.env.workspace
... sde_datasets = arcpy.ListDatasets()
... for sde_dataset in sde_datasets:
... sde_ds_names = sde_dataset.split('.')
... sde_ds_user = sde_ds_names[0]
... if sde_ds_user=='GYJCCH':
... for sde_fc in arcpy.ListFeatureClasses(feature_dataset=sde_dataset):
... sde_fc_names = os.path.split(sde_fc)
... sde_fc_fullnames = sde_fc_names[1].split('.')
... sde_fc_name = sde_fc_fullnames[1]
... sde_fc_shortname = sde_fc_name[-5:]
... if sde_fc_shortname in file_names and sde_fc_name[0:10]=='DLG_K_C80_':
... sde_fc_fields = arcpy.ListFields(sde_fc)
... for sde_fc_field in sde_fc_fields:
... print ('field name {0} with type {1} and length {2}'.format(sde_fc_field.name,sde_fc_field.type,sde_fc_field.length))
相关文章推荐
- Arcpy为本地数据按指定要求添加字段
- Python/ArcPy取出指定文件夹中所有MDB文件并导出字段
- 列举出记录集中的字段的函数
- laravel 创建表 字段列举
- ArcPy添加字段
- ArcPy修改字段值
- 利用arcpy按字段值筛选要素工具
- Arcpy查找指定用户的所有要素类并列举其属性信息
- arcpy 批量添加字段
- SQL SERVER的字段类型说明
- sql server 2005 数据库字段类型说明
- sfo查询条件,具体到查询字段
- sql语句操作表字段(一)
- 查找表名与所有字段名
- sql 根据指定条件获取一个字段批量获取数据插入另外一张表字段中+MD5加密
- 用arcgis根据字段进行分割数据
- MySQL查询指定字段
- 使用ResultSetMetaData显示字段的名字等信息
- sql查询同一字段值是否存在相同记录
- ehlib5.6 中,dbgrideh控件如何实现点击字段名称排序