Created
March 20, 2014 13:04
-
-
Save rabbleNaut/9663297 to your computer and use it in GitHub Desktop.
Uses Arcpy to iterate through features in a featuredataset to delete unwanted fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
batchFieldDelete.py | |
Iterate through features in featuredataset to delete unwanted fields. | |
Delete fields: | |
1 - Area_MI | |
2 - DOT_Feature | |
3 - Area_MI | |
''' | |
import arcpy | |
from arcpy import * | |
#hardcoded path to sde. consider creating model with input parameters for reusibility. | |
env.workspace = r"C:\Users\RABBEY-C\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\Comanche.sde\ENV_GIS.ENV_GIS.EMST_Districts" | |
#local drive for testing | |
#env.workspace = r"C:\Users\RABBEY-C\RA_GIS\Projects\RA_EMST\Updated_Phase_Features.gdb\District_Unions" | |
fcList = ListFeatureClasses() | |
for fc in fcList: | |
print "Updating feature class: %s" % fc | |
DeleteField_management(fc, ["DOT_TYPE", "DOT_FEATURE", "AREA_MI"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment