LAS Dataset To TIN (3D Analyst)
Summary
Exports a triangulated irregular network (TIN) from a LAS dataset.
Illustration
Usage
When a LAS dataset is specified as input, all the data points in the LAS files it references will be processed.
The LAS dataset layer can be used to filter LAS points by class code or return values. The layer can be created by using the Make LAS Dataset Layer tool, or by loading the LAS dataset in ArcMap or ArcScene and specifying the desired class codes and return values through the layer properties dialog box.
-
The MINIMUM, MAXIMUM, and AVERAGE point selection options utilize an automatically calculated window size area that is designed to produce a TIN dataset whose number of nodes can be adequately handled by the system.
Syntax
Parameter | Explanation | Data Type |
in_las_dataset |
The input LAS dataset. | LAS Dataset Layer |
out_tin |
The output TIN dataset. | TIN |
thinning_type (Optional) |
The type of thinning used for reducing the LAS data points saved as the nodes in the resulting TIN.
| String |
thinning_method (Optional) |
The thinning method defines the specific technique used for reducing the LAS data points, and impacts the way the Thinning Value gets interpretted. The available options depend on the selected Thinning Type. For RANDOM:
For WINDOW_SIZE:
| String |
thinning_value (Optional) |
The value associated with the selected Thinning Type and Thinning Method. For thinning methods available with the RANDOM point selection method:
For any WINDOW_SIZE thinning methods, the value represents the area that the extent of the LAS dataset is divided into for sampling data points. | Double |
max_nodes (Optional) |
The maximum number of nodes permitted in the output TIN. The default is 5 million. | Double |
z_factor (Optional) |
The factor by which elevation values will be multiplied. This is typically used to convert Z linear units that match those of the XY linear units. The default is 1, which leaves elevation values unchanged. | Double |
Code Sample
The following sample demonstrates the use of this tool in the Python window:
import arcpy
from arcpy import env
arcpy.CheckOutExtension('3D')
env.workspace = 'C:/data'
arcpy.LasDatasetToTin_3d('se_baltimore.lasd', 'se_bmore', 'RANDOM', 15, 3.28)
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''**********************************************************************
Name: LAS Dataset to TIN Example
Description: Create a TIN using bare earth lidar measurements. This
script is designed for use as a script tool.
**********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
# Set Local Variables
lasD = arcpy.GetParameterAsText(0)
inLas = arcpy.GetParameterAsText(1) #input las files
surfCons = arcpy.GetParameterAsText(2) #input surface constraints
sr = arcpy.GetParameter(3) #spatial reference of las dataset
outTin = arcpy.GetParameterAsText(4)
thinningType = arcpy.GetParameterAsText(5)
thinningMethod = arcpy.GetParameterAsText(6)
thinningValue = arcpy.GetParameter(7)
zFactor = arcpy.GetParameter(8)
try:
arcpy.CheckOutExtension('3D')
# Execute CreateLasDataset
arcpy.management.CreateLasDataset(inLas, lasD, 'RECURSION', surfCons, sr)
lasLyr = arcpy.CreateUniqueName('lasdToTin', 'in_memory')
classCode = 2
returnValue = 'LAST'
# Execute MakeLasDatasetLayer
arcpy.management.MakeLasDatasetLayer(lasD, lasLyr, classCode, returnValue)
# Define extent of the area of interest
env.extent(1426057, 606477, 1449836, 623246)
# Execute LasDatasetToTin
arcpy.ddd.LasDatasetToTin(lasLyr, outTin, thinningType,
thinningMethod, thinningValue, zFactor)
arcpy.CheckInExtension('3D')
except arcpy.ExecuteError:
print arcpy.GetMessages()
except:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate error information into message string
pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
.format(tbinfo, str(sys.exc_info()[1]))
msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)