gis python 要素赋序列值_ArcGIS Python 获取GDB中的要素类信息

我们经常会有这样的需求,想看下数据库中有多少个数据集多少个要素类,如果同数的方式会发现比较麻烦,那么我们可以通过一小段python脚本完成这样的任务,可以在桌面集成的窗口中完成一可以在单独python环境中完成只是没有太大的区别,下面是我实验的一段代码仅供参考。

#coding=utf-8

import arcpy

import os

arcpy.env.workspace = ‘E:\dat.gdb’

print ‘Processing…………….. ‘

fcs = []

dscount=0

fscount=0

for fds in arcpy.ListDatasets(”,”) + [”]:

if not fds==”:

dscount=dscount+1

for fc in arcpy.ListFeatureClasses(”,”,fds):

#yield os.path.join(fds, fc)

fcs.append(os.path.join(fds, fc))

for fcp in fcs:

print fcp

fscount=fscount+1

print ‘矢量数据集:’+str(dscount)+’个’

print ‘矢量要素类:’+str(fscount)+’个’

转载自:https://blog.csdn.net/esrichinacd/article/details/8593385

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值