I'm trying to write a script to convert CSV to Feature Class (overwriting if pre-existing).
Unfortunately my version of Arc (10.2.2) does not have "XYTableToPoint()" so I needed to find another way.
Traceback (most recent call last): File "Q:\scripts\CSVtoASMADPointFeatureClass.py", line 23, in <module> arcpy.FeatureClassToFeatureClass_conversion(Temp_Layer, Target_GDB, Target_FC_name, "", "" , "") File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\conversion.py", line 1675, in FeatureClassToFeatureClass raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Output Location: Dataset Q:\Data\Stations.gdb\Stations does not exist or is not supported Failed to execute (FeatureClassToFeatureClass).
Apparently the problem is with my parameters.
When I read ESRI's documentation on FeatureClasstoFeatureClass I saw their first example using only the first 3 paramaters, so I figured I was fine to just use the first 3 as well (last 3 optional).
For example, I didn't think I should need the 5th parameter (Field Mappings) because I want all the fields exactly as they are in the original CSV.
What is wrong with the Parameters as used in the "FeatureClassToFeatureClass" Arcpy Tool below?
import arcpy Source_CSV = r"\\int.ec\Data\Stations.csv" Target_FC = r"Q:\Data\Stations.gdb\Stations" Description = arcpy.Describe(Target_FC) Target_FC_name = Description.name Target_GDB = Description.catalogPath Temp_Layer = "Temp_Layer" SR = arcpy.Describe(Target_FC).spatialReference arcpy.MakeXYEventLayer_management(Source_CSV, "Lng", "Lat", Temp_Layer, SR, "") arcpy.FeatureClassToFeatureClass_conversion(Temp_Layer, Target_GDB, Target_FC_name, "", "", "")