ArcGIS 10.2.1 - Windows 7 pro - python 2.7 or 3.x
So someone gives you a .gdb with about 45 feature classes, each of which have anywhere from 10 to 25 Fields including sub types and domains.
How do you go about exporting that Database design to something you can look at as a whole...
If sub types are too much to ask for then they can be left out.
like this
featureClass1
Fieldname1
Fieldname2
Fieldname3
domain choice 1
domain choice 2
domain choice 3
Fieldname4
Fieldname5
domain choice 1
domain choice 2
domain choice 3
domain choice 4
featureClass2
etc. etc. etc.
I have exported domain lists but i am not quite sure how to get all of the fields and table names:
Here is a domain export script: But it isn't quite what i'm looking for
import arcpy
import sys, os
domains = arcpy.da.ListDomains("C:\Users\******\Desktop\AP_SCHEMA_WATER_V1.4.gdb")
listName = "domainNamesGDB.csv"
handle = open(listName, 'w')
for domain in domains:
handle.write("{0} \n".format(domain.name))
if domain.domainType == 'CodedValue':
coded_values = domain.codedValues
for val, desc in coded_values.iteritems():
handle.write('{0} , {1}\n'.format(val, desc))
elif domain.domainType == 'Range':
print('Min: {0}'.format(domain.range[0]))
print('Max: {1}'.format(domain.range[1]))
handle.close()
thanks in advance for any help you might be able to provide.
James
Solved! Go to Solution.
x-ray exports the database structure out to an excel file with easy to view
tabs for each table/feature class. The module itself does use XML but is
transparent to the user if you do not want to dig in to deep. It has proven
to invaluable when handed an unfamiliar database and asked to work with it.
P.S. you do need excel installed on the system to run the module
I've moved your post into the Managing Data space. You will get a much better answer here as the GeoNet Help is intended for community help and feedback. You can see more on the community structure, and what topics are under each space from the following documents:
ArcGIS Discussion Forums Migration Strategy
Thanks!
Timothy
Have you tried x-ray for arcCatalog?
http://www.arcgis.com/home/item.html?id=9ea218ff575f4a5195e01a2cae03a0ae
This looks useful, however I am not up on XML parsing at this point in my career. I now have a script that will list all of the feature classes as well as their fields and the types.
I can export the domains separately but the last piece would be to list or tie the domains to the correct fields in the output.
I will be looking at that this afternoon and will post any results that I come up with.
Thanks for your input.
x-ray exports the database structure out to an excel file with easy to view
tabs for each table/feature class. The module itself does use XML but is
transparent to the user if you do not want to dig in to deep. It has proven
to invaluable when handed an unfamiliar database and asked to work with it.
P.S. you do need excel installed on the system to run the module
I tried it. Super easy!
Thank you!
That is an amazing tool!