Make LAS Dataset Layer (Data Management)
Summary
Creates a LAS dataset layer that can apply filters on LAS files and enable or disable surface constraints referenced by a LAS dataset.
Usage
This tool creates a temporary layer stored in memory that can be preserved as a layer file by using the Save To Layer File tool.
LAS points can be classified into a number of categories that describe the material encountered by the lidar return, such as ground, building, or water. The American Society for Photogrammetry and Remote Sensing (ASPRS) defined the following class codes for LAS file versions 1.1, 1.2, and 1.3:
Classification Value
Classification Type
0
Never Classified
1
Unassigned
2
Ground
3
Low Vegetation
4
Medium Vegetation
5
High Vegetation
6
Building
7
Noise
8
Model Key
9
Water
10
Reserved for ASPRS Definition
11
Reserved for ASPRS Definition
12
Overlap
13–31
Reserved for ASPRS Definition
Note:While the LAS 1.0 specifications provide class codes ranging from 0 to 255, it does not have a standardized classification scheme. Any class codes used in 1.0 files would typically be defined by the data vendor and provided through auxiliary information.
The layer can be used as a staging ground for generating input into other geoprocessing tools that accept a LAS dataset. For example, if a raster or TIN dataset is needed from first return bare earth lidar data, the filter options can be used to select the second class code and first return value. The resulting LAS dataset layer could then be used in the LAS Dataset To Raster tool or the LAS Dataset To TIN tool to create the desired output.
Syntax
Parameter | Explanation | Data Type |
in_las_dataset |
The input LAS dataset. | LAS Dataset Layer |
out_layer |
The name of the resulting LAS dataset layer. Text followed by a backslash or forward slash will be used to denote a group layer. | Las Dataset Layer |
class_code [class_code,...] (Optional) |
The classification codes to use as a query filter for LAS data points. Valid values range from 1 to 32. No filter is applied by default. | Long |
return_values [return_values,...] (Optional) | Specifies the return values to be used for filtering the data points. When nothing is specified, all returns are used. Valid return options include any number from 1 to 5 and the following keywords:
| String |
no_flag (Optional) | Indicates whether data points that do not have any classification flags assigned should be enabled for display and analysis.
| Boolean |
synthetic (Optional) | Indicates whether data points flagged as synthetic, or points that originated from a data source other than lidar, should be enabled for display and analysis..
| Boolean |
keypoint (Optional) | Indicates whether data points flagged as model key-points, or significant measurements that should not be thinned away, should be enabled for display and analysis..
| Boolean |
withheld (Optional) | Indicates whether data points flagged as withheld, which typically represent unwanted noise measurements, should be enabled for display and analysis.
| Boolean |
surface_constraints [surface_constraints,...] (Optional) |
The name of the surface constraint features that will be enabled in the layer. All constraints are enabled by default. | String |
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.MakeLasDatasetLayer_management('Baltimore.lasd', 'Baltimore Layer',
2, 'LAST', 'INCLUDE_UNFLAGGED',
'EXCLUDE_SYNTHETIC', 'INCLUDE_KEYPOINT',
'EXCLUDE_WITHHELD')
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''*********************************************************************
Name: Export Elevation Raster from Ground LAS Measurements
Description: This script demonstrates how to export
ground measurements from LAS files to a raster using a
LAS dataset. This sample is designed to be used as a script
tool.
*********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
try:
# Set Local Variables
inLas = arcpy.GetParameterAsText(0)
recursion = arcpy.GetParameterAsText(1)
surfCons = arcpy.GetParameterAsText(2)
classCode = arcpy.GetParameterAsText(3)
returnValue = arcpy.GetParameterAsText(4)
spatialRef = arcpy.GetParameterAsText(5)
lasD = arcpy.GetParameterAsText(6)
outRaster = arcpy.GetParameterAsText(7)
cellSize = arcpy.GetParameter(8)
zFactor = arcpy.GetParameter(9)
if arcpy.ProductInfo == 'ArcView':
arcpy.CheckOutExtension('3D')
# Execute CreateLasDataset
arcpy.management.CreateLasDataset(inLas, lasD, recursion, surfCons, sr)
# Execute MakeLasDatasetLayer
lasLyr = arcpy.CreateUniqueName('Baltimore')
arcpy.management.MakeLasDatasetLayer(lasD, lasLyr, classCode, returnValue)
# Execute LasDatasetToRaster
arcpy.conversion.LasDatasetToRaster(lasLyr, outRaster, 'ELEVATION',
'TRIANGULATION LINEAR WINDOW_SIZE 10', 'FLOAT',
'CELLSIZE', cellSize, zFactor)
arcpy.GetMessages()
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)
finally:
arcpy.management.Delete(lasLyr)