Error 000212: Cannot create XY event source

3138
0
01-31-2014 03:27 PM
CindyHamfler
New Contributor II
I had the Python script below running on my old machine (Windows XP with ArcGIS 10).  When I run it on my new machine (Windows7 with ArcGIS 10.1), it throws up the 000212 ERROR.
It also says: "File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 6322 in MakeXYEventLayer raise e..."
Because of the machine change and lack of understanding the error code, I'm not sure if something has changed between 10 and 10.1, or Python versions?  I know this is ineloquent code, basically, I'm trying to take multiple csv files and in a loop, make an XY layer out of them and then convert to Feature class that gets merged into a master dataset.  It would be more efficient if I could only include the 'successful' fixes from the csv, but I don't care about being efficient as much as just getting this to work again!
Can anyone chime in with what the possible problem could be?  I'd appreciate the help!

--------------------------------------------------------------------
#code to convert csvs into master dataset
InGPS=InFolder+'\GPS*.csv'
lstGPS = glob.glob(InGPS)
lnGPS= len(lstGPS)
OutMasterFC=arcpy.GetParameterAsText(2)             
arcpy.AddMessage("Now to turn the "+str(lnGPS)+" csv files into points....")
for file in lstGPS:
    filename = file.rsplit('\\',1)
    outname = filename[1].replace('.csv','')
    PtOutname = outname.replace(' ','')
    outshp = "Out_"+PtOutname
    #outstr = str(OutGdb)
    event = arcpy.MakeXYEventLayer_management(file,"GPSLongitude", "GPSLatitude", outshp, "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision", "")
    arcpy.AddMessage("working on file: "+outshp)
    FC= arcpy.FeatureClassToFeatureClass_conversion(event,OutFgdb,outshp)
    selection = arcpy.Select_analysis(FC,"tmp","\"GPSFixAttempt\" = 'Succeeded'")
    arcpy.Append_management(selection,OutMasterFC,"NO_TEST")
-----------------------------------------------------
Tags (2)
0 Replies