Using the ArcPy Layer To KML (Conversion) tool, how can I control the naming of the nesting in the KMZ structure?
My code gives me this:
I don't know why it chose the field that has the name "Oregon" (that field name is "state_name" in the SHP). I would like for it to use the "county_name" field.
How can I control the output so that it is like this:
## steps
# specify county (done in loop, simplified here)
# define selection criteria
# convert SHP to Layer for use in Select function
# select subset
# save to KMZ
c = 'Lincoln'
criteria = '"county_name" = {}'.format(c)
arcpy.MakeFeatureLayer_management(myfile.shp, 'myLayer')
subset = arcpy.SelectLayerByAttribute_management('myLayer', "NEW_SELECTION", criteria)
arcpy.LayerToKML_conversion(subset, 'myoutput.kmz')