kylaj

Append .lyr to file geodatabase

Discussion created by kylaj on Jun 4, 2012
Latest reply on Jun 4, 2012 by mzcoyle
Hi all,
Just learning python script and was wondering if you could help me out. I've got a script that will be converting a KML to lyr and then appending it to a feature class in a file geodatabase.

import arcpy
arcpy.env.workspace = r"C:\Users\KJacobsen\Desktop\Griffiths\Griffiths.gdb"
arcpy.env.overwriteOutput = True
#import GPS files
input = r"C:\Users\KJacobsen\Desktop\Griffiths\04232012_Documents\DATA from TEDEBAYE\garmin\120418 GARMIN\CCBJ.kmz"
outputFolder = r"C:\Users\KJacobsen\Desktop\Griffiths"
lyr = arcpy.KMLToLayer_conversion(input, outputFolder, "KML3")
FC = r"C:\Users\KJacobsen\Desktop\Griffiths\Griffiths.gdb\CHAMP"
arcpy.Append_management(lyr,FC,"NO_TEST")

I'm receiving the following error and am unsure of how to proceed...
Thanks in advance,
Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 312, in RunScript
    exec codeObject in __main__.__dict__
  File "...\Desktop\ImportData.py", line 9, in <module>
    arcpy.Append_management(lyr,FC,"NO_TEST")
  File "...\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 2965, in Append
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000349: The input parameter is not a Table View
Failed to execute (Append).

Outcomes