deana444

Cannot create terrains from feature class

Discussion created by deana444 on Jun 17, 2013
Hi,

I am trying to create a terrain from an input .las file going from .las to multipoint and then the multipoint feature class to terrain.
I can successfully create .las to multipoint, but cannot go from the multipoint to terrain step.

I am copying the entire code so it is easier to follow and will bold the section with a problem

I can get up to the point where I need to add the feature class(es) to the terrain, but at this point, the code stops. I do not get an error warning, it just states code completed without finishing.
I know the error is in how I'm trying to add the feature class, but I can't seem to get it to work.

import arcpy
import os
             # ArcGIS Parameter Options
Geo_output = arcpy.GetParameterAsText(0)  # Input, Folder
Geo_name = arcpy.GetParameterAsText(1)  # Input, String
SR  = arcpy.GetParameterAsText(2)  # Input, Spatial Reference
InLAS  = arcpy.GetParameterAsText(3)  # Input, File, Multi Value, Filter = las
pnt_spacing = arcpy.GetParameterAsText(4)  # Input, Double
OutFC_1  = arcpy.GetParameterAsText(5)  # Input, String
class_1  = arcpy.GetParameterAsText(6)  # Input, Long, Optional
return_1  = arcpy.GetParameterAsText(7)  # Input, String, Optional, Default = ANY_RETURNS
OutFC_2  = arcpy.GetParameterAsText(8)  # Input, String
class_2  = arcpy.GetParameterAsText(9)  # Input, Long, Optional
return_2  = arcpy.GetParameterAsText(10) # Input, String, Optional, Default = ANY_RETURNS
clip  = arcpy.GetParameterAsText(11) # Input, Feature Class, Optional

OutFC  = [OutFC_1, OutFC_2]
classif = [class_1, class_2]
returns  = [return_1, return_2]
FD_name  = Geo_name + "_Feature_Dataset"
FD_addr  = os.path.join(Geo_output,Geo_name + ".gdb")
FC_addr  = os.path.join(FD_addr, FD_name)
 
try:
arcpy.CreateFileGDB_management(Geo_output, Geo_name)
arcpy.CreateFeatureDataset_management(FD_addr, FD_name, SR)
for fc,cls,ret in zip(OutFC,classif,returns):
  result= arcpy.LASToMultipoint_3d(InLAS,os.path.join(FC_addr,fc),pnt_spacing,
                                                              cls,ret,"#",SR,"las","1","NO_RECURSION")  
  name = fc + "_Terrain"
                arcpy.CreateTerrain_3d(FC_addr,name,pnt_spacing,"50000","#",
                                                "ZTOLERANCE","ZMIN","NONE","1")
  terrain = os.path.join(FC_addr,name)
  arcpy.AddTerrainPyramidLevel_3d(terrain,"ZTOLERANCE",".5 1000")
 
  embed = fc + "_embed"
  feature_class = result + ' Shape Mass_Points 1 0 0.5 true false' + embed+ ' <None> false'
  arcpy.AddFeatureClassToTerrain_3d(terrain, feature_class) # Insert Clip
  arcpy.BuildTerrain_3d(MP,"NO_UPDATE_EXTENT")

 
except:
    print arcpy.GetMessages(2)

Outcomes