I have an existing ArcGIS 10 geodatabase which has a complicated schema containing multiple tables and joins, and I wish to simplify this for faster web delivery.
For example, Featureclass1 is related to Table1, Table2, TableN, and I wish to copy or import the attributes from each Table onto Featureclass1. This will result in a single Featureclass containing all attributes.
What is the fastest way to do this in a repeatable manner (ie, without doing it manually in ArcCatalog)?
This is what I'm considering:
-
When creating a new featureclass or table in ArcCatalog, there is the option to Import the schema from an existing table/FC. However, this only allows you to import from Table1 (if you then choose Table2, it drops the fields from Table1).
-
The Geodatabase Diagrammer is a great tool for reporting on an existing schema, and designing a new one – but I can't see any options to import multiple fields simply (it seems to require manual entry of each new field).
-
writing a Python script to do it iteratively. Is this the best option?
Note that I'm only concerned with the schema at this stage, not the actual data import.
Best Answer
I would personally use arcpy.MakeQueryTable_management and then use that table to create a new featureclass with that as its template.
Please note, that the layer that is created by the tool is temporary and will not persist; you have to use the item created by this, in creating a permanent table
Alternatively, you could just code the creation of the table using arcpy.CreateTable_management, with something like this:
That way you can design and build your FC anytime you like.