LAS Dataset To Raster (Conversion)
Summary
Creates a raster using elevation, intensity, or RGB values stored in the lidar files (*.las) referenced by the 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.
-
When exporting a large raster, consider specifying the Output Data Type as an integer to save on disk space if the accuracy requirements of your z-values are such that they can be represented by integer data.
Including a study area boundary as a clip constraint in the definition of the input LAS dataset is highly recommended. One reason is to prevent interpolation from occurring outside the real data extent of the survey. Secondly, there can be a severe performance penalty when using natural neighbor options if the data area is not properly defined.
Note:When using BINNING only clip, erase, and replace constraints are honored. Breaklines and anchor points are not. The triangulation option honors all types of constraints but takes longer to execute.
Syntax
Parameter | Explanation | Data Type |
in_las_dataset |
The input LAS dataset. | LAS Dataset Layer |
out_raster |
The location and name of the output raster. When storing a raster dataset in a geodatabase or in a folder such as an Esri Grid, no file extension should be added to the name of the raster dataset. A file extension can be provided to define the raster's format when storing it in a folder:
If the raster is stored as a TIFF file or in a geodatabase, its raster compression type and quality can be specified using geoprocessing environment settings. | Raster Dataset |
value_field (Optional) |
Specifies the lidar information that will be used in generating the raster output.
| String |
interpolation_type "BINNING {cell_assignment_type} {void_fill_method}" or "TRIANGULATION {interpolation_method} {point_thinning_type} {point_selection_method} {resolution}" (Optional) |
The interpolation method used to produce the raster. BINNING—Cell values are obtained using the points that fall in the extent of the cell, with the exception of cells that do not contain points in their extent. The following options are available for this technique:
TRIANGULATION—Cell values are obtained by interpolating measurements from a triangulated representation of the LAS dataset. The following options are available for this technique:
| String |
data_type (Optional) |
The data type of the output raster can be defined by the following keywords:
| String |
sampling_type (Optional) |
Specifies the method used for interpreting the Sampling Value to define the resolution of the output raster.
| String |
sampling_value (Optional) |
Specifies the value used in conjunction with the Sampling Type to define the resolution of the output raster. | Double |
z_factor (Optional) |
The factor by which Z values will be multiplied. This is typically used to convert Z linear units to match 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.LasDatasetToRaster_3d('baltimore.lasd', 'baltimore.tif', 'INTENSITY',
'TRIANGULATION LINEAR WINDOW_SIZE 10', 'FLOAT',
'CELLSIZE', 10, 3.28)
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)