I wrote a script that, ideally, loads raw .las (LiDAR data) files into a geodatabase, then creates a terrain from the multipoint files that are created. When I run the script though I get:
ExecuteError: ERROR 000210: Cannot create output C:\Users\peter\Desktop\test.gdb\bare_earth\1las The table name is invalid. Failed to execute (LASToMultipoint)
So far the only thing I can figure out is that Windows 7 keeps changing my folder permissions to read-only, but I can still manually create, edit, and delete in the directories.
import os import arcpy, math, glob from arcpy import env arcpy.CheckOutExtension("3D") arcpy.env.overwriteOutput = True #make workspace in memory arcpy.env.workspace = "in_memory" #define parameters using GetParameter in ArcMap geodatabase = arcpy.GetParameter(0) #0)input Geodatabase outfeaturedataset = arcpy.GetParameter(1) #1)Desired Name for the feature class projection = arcpy.GetParameter(2) #2)coordinate system terrain_name = arcpy.GetParameter(3) #3)Name of the Terrain class_code = arcpy.GetParameter(4) #4) the return class code to use lasdirectory = arcpy.GetParameter(5) #5) directory to get las data in #designate directory where .las files are located os.chdir (lasdirectory) created_FC_tool = arcpy.CreateFeatureDataset_management(geodatabase, outfeaturedataset, projection) created_FC = created_FC_tool.getOutput(0) #Create a Terrain arcpy.CreateTerrain_3d (created_FC, terrain_name, 1.24605815948, 50000, '', 'WINDOWSIZE', 'ZMIN', 'NONE', 1) output_terrain = os.path.join (created_FC, terrain_name) arcpy.AddTerrainPyramidLevel_3d (output_terrain, 'WINDOWSIZE', '2.5 1000; 5 2000; 10 4000; 20 8000; 40 16000') #process the .las file and add to the feature dataset and terrain for LASfiles in glob.glob("*.las"): print LASfiles pointinfo = "point_file_information" #Get Pointfile information arcpy.PointFileInformation_3d(LASfiles, pointinfo, "LAS", "", projection) #get average point spacing variable pointspacing = arcpy.SearchCursor (pointinfo) field = "Pt_Spacing" for row in pointspacing: avg_space = (row.getValue(field)) print avg_space #convert las to multipoint #create lable for multipoint file listlable = list(LASfiles) del listlable[-4] multipointlable = ''.join(listlable) print multipointlable print created_FC outputPlable = os.path.join (created_FC, multipointlable) arcpy.LASToMultipoint_3d(LASfiles, outputPlable, 1.5, class_code, "", "INTENSITY", projection, "las", 1) print outputPlable outputPlable_parameters = outputPlable + ' Shape masspoints 1 0 40 true false R06305328las_embed <None> false' print outputPlable_parameters arcpy.AddFeatureClassToTerrain_3d (output_terrain, outputPlable_parameters) #Build the terrain arcpy.BuildTerrain_3d (output_terrain)
If it is a Windows 7 problem I don't know what I'm going to do as my work computer is locked down by our help desk.