ArcGIS Python obtains information about element classes in GDB

Source: Internet
Author: User

We often have this kind of requirement. We want to see how many data sets and how many element classes are in the database. If we use the same number, we will find it troublesome, you can use a small Python script to complete such a task. You can complete the task in the desktop integration window in a separate Python environment, but there is no big difference, below is a section of my experimentCodeFor reference only.

# 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 'vector Dataset: '+ STR (dscount) +'
Print 'vector element class: '+ STR (fscount) +'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.