Available with 3D Analyst license.
Available with Spatial Analyst license.
Summary
Calculates or updates statistics for a LAS dataset and generates an optional statistics report.
Usage
Computing statistics will create a spatial and attribute index that helps optimize display and analysis performance. Statistics also provide a more accurate estimate for average point spacing, and additional details about point attributes. The statistics are stored in a file with the same name as its corresponding LAS file, but ending in the .lasx extension.
Statistics enable filtering options for a LAS dataset layer to automatically display the available class codes and return values in the LAS files. The LAS dataset layer can be filtered through its Layer Properties dialog box or the Make LAS Dataset Layer tool.
The optional statistics report file provides an overview of LAS properties of all files in the LAS dataset or each individual LAS file in a text format that can be imported into any number of applications.
If a LAS file's classification codes or flags are modified, its statistics get invalidated and will need to be recomputed. Similarly, if a LAS dataset has new LAS file references added, it also will result in the statistics being invalidated.
Syntax
arcpy.management.LasDatasetStatistics(in_las_dataset, {calculation_type}, {out_file}, {summary_level}, {delimiter}, {decimal_separator})
Parameter | Explanation | Data Type |
in_las_dataset | The LAS dataset to process. | LAS Dataset Layer |
calculation_type (Optional) | Specifies whether statistics will be calculated for all lidar files or only for those that do not have statistics:
| Boolean |
out_file (Optional) | The output text file that will contain the summary of the LAS dataset statistics. | Text File |
summary_level (Optional) | Specify the type of summary contained in the report.
| String |
delimiter (Optional) | The delimiter used to indicate the separation of entries in the columns of the text file table.
| String |
decimal_separator (Optional) | The decimal character used in the text file to differentiate the integer of a number from its fractional part.
| String |
Derived Output
Name | Explanation | Data Type |
derived_las_dataset | The updated LAS dataset. | LAS Dataset Layer |
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.LASDatasetStatistics_3d("test.lasd", "NO_FORCE", "LAS_FILE",
"DECIMAL_POINT", "SPACE", "LAS_summary.txt")
The following sample demonstrates the use of this tool in a stand-alone Python script.
'''*********************************************************************
Name: Modify Files in LAS Dataset& Calculate Stats for LASD
Description: Adds files & surface constraints to a LAS dataset, then
calculates statistics and generates report.
*********************************************************************'''
# Import system modules
import arcpy
try:
# Script variables
arcpy.env.workspace = 'C:/data'
lasd = 'sample.lasd'
oldLas = ['2006', '2007/file2.las']
newLas = ['2007_updates_1', '2007_updates_2']
oldSurfaceConstraints = ['boundary.shp', 'streams.shp']
newSurfaceConstraints = [['sample.gdb/boundary', '<None>',
'Soft_Clip']
['sample.gdb/streams', 'Shape.Z',
'Hard_Line']]
arcpy.management.RemoveFilesFromLasDataset(lasd, oldLas,
oldSurfaceConstraints)
arcpy.management.AddFilesToLasDataset(lasd, newLas, 'RECURSION',
newSurfaceConstraints)
arcpy.management.LasDatasetStatistics(lasd, "UPDATED_FILES",
"lasd_stats.txt",
"LAS_FILE", "DECIMAL_POINT",
"SPACE", "LAS_summary.txt")
except arcpy.ExecuteError:
print(arcpy.GetMessages())
except Exception as err:
print(err.args[0])
Environments
Licensing information
- Basic: Requires 3D Analyst or Spatial Analyst
- Standard: Yes
- Advanced: Yes