How do I get the ArcGIS 9.3 geoprocessor to copy all of the fields of a feature class?
Here is a description of what I'm trying to do:
I am modifying an existing script created by a developer not on the program anymore. The script's purpose is to extract a given feature set into a zipped .gdb. Therefore, the script takes a feature set as input. In the FeatureSet that I am attempting to export (which is a feature set representing major lakes), the fields are DEPTH, NAME, OBJECTID, Shape_Area, Shape_Length, SQKM, SQMI, and SURF_ELEV. The .gdb resulting from this script, however, only contains OBJECTID, Shape (where'd that come from??), Shape_Length, and Shape_Area.
I am exporting the feature set via
gp.CopyFeatures(featureSet, scratchGdb + os.path.sep + lyrName)
The .gdb is successfully created, but only some fields are there! Why am I losing some of the fields in this feature class when exporting it to a .gdb?
Through using Komodo IDE, I was able to remote debug the script, and I saw that the input feature set only had the four fields that ended up in the exported .gdb.
Does this have to do with setting a schema for the feature set?
gp.CreateFeatureClass
was there. As per your recommendations, I removed thegp.CreateFeatureClass
line and left thegp.CopyFeatures
line there. As you said, the .gdb was created. However the same issue is occurring. In the FeatureSet that I am using, the fields in a featureSet which contains major lakes are DEPTH, NAME, OBJECTID, Shape_Area, Shape_Length, SQKM, SQMI, and SURF_ELEV. The .gdb resulting from this sc – user5521 Jan 17 '12 at 23:04