Here is the issue, which is quite simple:
tried to create six individual shp files (six counties in IL) by using Select by Attributes, but got six blank shp files.
Input: IL_counties.shp, NAD83
I tested a python script as follows:
import arcpy
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/Users/....."
try:
arcpy.MakeFeatureLayer_management("IL_counties.shp", "lyr")
counties =["LAKE", "COOK", "DUPAGE", "KANE", "MCHENRY", "WILL"]
for k in counties:
qry = "COUNTY_NAM = + 'k' "
arcpy.SelectLayerByAttribute_management("lyr", "NEW_SELECTION", qry )
arcpy.FeatureClassToFeatureClass_conversion("lyr", "C:/Users/.....", k+"02.shp")
except: print "An error occurred during creation"
I tried both CopyFeatures_management() and FeatureClassToFeatureClass_conversion().
No error was reported, but the outputs are all blank. In particular, all the Extent values are blank (screenshot).
What might be wrong? Many thanks!