mikevann

Trying to Create Feature Class - Error Executing Function

Discussion created by mikevann on Apr 26, 2013
Latest reply on Apr 29, 2013 by jskinner-esristaff
Hi

I'm working on a project of converting a csv table into ArcMap readable shapefiles. I have set parameters for the Create Feature Class tool, but am getting an "error executing function" message (error 999999). I've tried setting different parameters(I'm using default parameters which I indicate with #), but keep getting this message. I also created an xy event layer before running Create Feature ClassAny other ideas?

Thanks,
Mike

data = []
inFile = open(inputFile, 'r')
outFile = open(outputFile, 'w')

count = 0
for n in range(6):
    count = count + 1
    line = inFile.readline()

while line:
    count = count + 1
    line = inFile.readline()
    print 'Row', count, 'line info=', line[:72]
    lineList = line.split(',')
    newList = lineList[:72]
    print 'line info =', newList  
    newLine = ','.join(newList)
    newLine = newLine + '\n'
    formatLine = newLine.replace("/","_")
    outFile.write(formatLine) 

table = outputFile
in_x_field = "LongitudeNAD83"
in_y_field = "LatitudeNAD83"
out_layer = "xyLayer.lyr"
spatial_reference = arcpy.SpatialReference("Coordinate Systems/Geographic Coordinate Systems/North America/NAD 1983.prj")
arcpy.MakeXYEventLayer_management(table, in_x_field, in_y_field, out_layer, spatial_reference)

out_path = os.path.dirname(outputFile)
out_name = outputFile[:-4] + ".shp"
geometry_type = "POINT"
spatial_reference = arcpy.SpatialReference("Coordinate Systems/Geographic Coordinate Systems/North America/NAD 1983.prj")
arcpy.CreateFeatureclass_management(out_path, out_name, geometry_type, "#", "#", "#", spatial_reference, "#", "#", "#", "#")

Outcomes