I am trying to convert XYZ-data to a point feature class. I've done this successfully in ArcMap, however, when I copy the python snippet, I get a RuntimeError.
I did make some minor changes to make the code more readable, and to loop through a series of files. Anyway, the same problems arose when I used the original python snippet.
This is my code - for the sake of brevity I have replaced some of the long path names by variables:
import os # enables interaction with operating system import arcpy # enables use of tools within the arcpy package arcpy.CheckOutExtension('3D') RDnew = "PROJCS['RD_New',GEOGCS['GCS_Amersfoort',DATUM['D_Amersfoort',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Double_Stereographic'],PARAMETER['False_Easting',155000.0],PARAMETER['False_Northing',463000.0],PARAMETER['Central_Meridian',5.38763888888889],PARAMETER['Scale_Factor',0.9999079],PARAMETER['Latitude_Of_Origin',52.15616055555555],UNIT['Meter',1.0]]","#","#","DECIMAL_POINT" #this is just the coordinate system copied from the python snippet to make it more readible. for fn in os.listdir('.'): if (fn[-4:] == '.pts' or fn[-4:] == '.txt'): print fn + ' is processing.' print 'Converting XYZ-data to point feature class.' pts_shp = fn[0:7] + '.shp' # using fn[0:7] to get rid of the .pts or .txt extension of the input file arcpy.ASCII3DToFeatureClass_3d(fn,'XYZ','shp_points/' + pts_shp,'POINT','1',RDnew,"#","#","DECIMAL_POINT")
This last line is where I get the error.
I had some errors before (among which the infamous Error 999999, which I managed to get rid off. and 'failed to execute function', which has also been solved), but I don't see what else is wrong with my code here.
Could anyone help me out and explain to me what is going wrong?
I already checked for spaces and dots in the paths and file names. My best guess would be the input or output path, but I don't see the problem.