Make LAS Dataset Layer (Data Management)

License Level:BasicStandardAdvanced

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

Syntax

MakeLasDatasetLayer_management (in_las_dataset, out_layer, {class_code}, {return_values}, {no_flag}, {synthetic}, {keypoint}, {withheld}, {surface_constraints})
ParameterExplanationData 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:

  • LAST_RETURNThe last return available for each lidar pulse.
  • FIRST_OF_MANYThe first return available for each lidar pulse with multiple returns.
  • LAST_OF_MANYThe last return available for each lidar pulse with multiple returns.
  • SINGLE_RETURNThe data point from a lidar pulse that only has one return.
String
no_flag
(Optional)

Indicates whether data points that do not have any classification flags assigned should be enabled for display and analysis.

  • INCLUDE_UNFLAGGEDUnflagged points will be displayed. This is the default.
  • EXCLUDE_UNFLAGGEDUnflagged points will not be displayed.
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..

  • INCLUDE_SYNTHETICSynthetic points will be displayed. This is the default.
  • EXCLUDE_SYNTHETICSynthetic points will not be displayed.
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..

  • INCLUDE_KEYPOINTModel key-points will be displayed. This is the default.
  • EXCLUDE_KEYPOINTModel key-points will not be displayed.
Boolean
withheld
(Optional)

Indicates whether data points flagged as withheld, which typically represent unwanted noise measurements, should be enabled for display and analysis.

  • EXCLUDE_WITHHELDWithheld points will not be displayed. This is the default.
  • INCLUDE_WITHHELDWithheld points will be displayed.
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

MakeLasDatasetLayer example 1 (Python window)

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')
MakeLasDatasetLayer example 2 (stand-alone script)

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)

Environments

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013