LAS Point Statistics As Raster (Data Management)
Summary
Creates a raster whose cell values reflect statistical information about measurements from LAS files referenced by a LAS dataset.
Usage
Consider using PREDOMINANT_LAST_RETURN for the Method parameter to identify locations with higher return values that could indicate the presence of vegetation.
Consider using Z_RANGE for the Method parameter to determine locations with potential outliers.
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.
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 |
method (Optional) |
The type of statistics collected about the LAS points in each cell of the output raster.
| 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 |
Code Sample
The following sample demonstrates the use of this tool in the Python window:
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.LasPointStatsAsRaster_3d("test.lasd", "lidar_intensity.img",
"INTENSITY_RANGE", "CELLSIZE", 15)
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''**********************************************************************
Name: LAS Point Statistics As Raster
Description: Identifies the most frequently occurring return value for
each pulse in a given set of LAS files.
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
sr = arcpy.GetParameter(2) #spatial reference of las dataset
statsRaster = arcpy.GetParameterAsText(3)
try:
arcpy.CheckOutExtension('3D')
# Execute CreateLasDataset
arcpy.management.CreateLasDataset(inLas, lasD, 'RECURSION', '', sr)
# Execute LasPointStatsAsRaster
arcpy.management.LasPointStatsAsRaster(lasD, statsRaster,
"PREDOMINANT_RETURNS_PER_PULSE",
"CELLSIZE", 15)
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)