LAS Point Statistics As Raster (Data Management)

License Level:BasicStandardAdvanced

Summary

Creates a raster whose cell values reflect statistical information about measurements from LAS files referenced by a LAS dataset.

Usage

Syntax

LasPointStatsAsRaster_management (in_las_dataset, out_raster, {method}, {sampling_type}, {sampling_value})
ParameterExplanationData 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:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .img—ERDAS IMAGINE
  • .png—PNG
  • .tif—TIFF

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.

  • PULSE_COUNTThe number of last return points.
  • POINT_COUNTThe number of points from all returns.
  • PREDOMINANT_LAST_RETURNThe most frequent last return value.
  • PREDOMINANT_CLASSThe most frequent class code.
  • INTENSITY_RANGEThe range of intensity values.
  • Z_RANGEThe range of elevation values.
String
sampling_type
(Optional)

Specifies the method used for interpreting the Sampling Value to define the resolution of the output raster.

  • OBSERVATIONSDefines the number of cells that divide the lengthiest side of the LAS dataset extent.
  • CELLSIZEDefines the cell size of the output raster. This is the default.
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

LasPointStatsAsRaster example 1 (Python window)

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

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)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires 3D Analyst or Spatial Analyst
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013