I'm currently formatting our GIS data for use in a mobile app. The purpose of altering the data is to reduce the output file size that's imported into the app. I need to delete many fields from many feature classes. I will need to run this script about every two months to provide updated data.
The first part of my script copies the feature classes from our SDE geodatabase to a file geodatabase using arcpy.FeatureClassToFeatureClass_conversion()
. This function has a field_mapping
parameter which I'm not very familiar with.
What would be the quickest way to delete many fields from many feature classes?
Using the field_mapping
parameter, or just using arcpy.DeleteField_management()
? I would think field_mapping
.
The real problem is that I want to remove around 30 fields from each feature class, and only keep around 4-5.
With field_mapping
, (I haven't researched this yet) is there a way to simply state only the fields I want to keep without listing all the fields I want to remove too?