Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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)

Any help is greatly appreciated, if it is a Windows 7 problem I don't know what I'm going to do as my work computer is locked down like Fort Knox by our help desk :(

Thanks in advance,

Pete

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Inside a Geodatabase, there are certain ways you can't name a table or Feature Class. Beginning with a number is one of those ways.

Validating Table and Field Names in Python: http://resources.arcgis.com/en/help/main/10.1/index.html#//002z00000020000000

Try renaming your table to las_1 or something and see if it works

share|improve this answer
    
Thanks a lot, it's always some mundame detail that I miss. Thanks again, I probably would have never stumbled on that. –  Pete Jun 13 '13 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.