Set LAS Class Codes Using Features (3D Analyst)
Summary
Classifies data points in LAS files referenced by a LAS dataset using point, line, and polygon features.
Usage
LAS points can be classified into a number of categories that describe the material encountered by the lidar return, such as ground, building, or water. The American Society for Photogrammetry and Remote Sensing (ASPRS) defined the following class codes for LAS file versions 1.1, 1.2, and 1.3:
Classification Value
Classification Type
0
Never Classified
1
Unassigned
2
Ground
3
Low Vegetation
4
Medium Vegetation
5
High Vegetation
6
Building
7
Noise
8
Model Key
9
Water
10
Reserved for ASPRS Definition
11
Reserved for ASPRS Definition
12
Overlap
13–31
Reserved for ASPRS Definition
Note:While the LAS 1.0 specifications provide class codes ranging from 0 to 255, it does not have a standardized classification scheme. Any class codes used in 1.0 files would typically be defined by the data vendor and provided through auxiliary information.
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.
LAS data points that fall within the 2-dimensional area of the buffer specified for the input features will be classified.
-
Consider using the points obtained from Locate Outliers to classify LAS points as Noise.
Syntax
Parameter | Explanation | Data Type |
in_las_dataset |
The input LAS dataset. | LAS Dataset Layer |
feature_class [[features, buffer_distance, new_class, synthetic, key_point, withheld],...] |
Specify one or more feature classes that will be used to define class code values for the lidar files referenced by a LAS dataset. Each feature will have the following options that can be specified:
| Value Table |
compute_stats (Optional) | Specifies whether statistics should be computed for the LAS files referenced by the LAS dataset. The presence of statistics allows the LAS dataset layer's filtering and symbology options to only show LAS attribute values that exist in the LAS files.
| Boolean |
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.SetLasClassCodesUsingFeatures_3d("test.lasd", [["lake.shp 0 9"],
["outliers.shp", 5, "NO_CHANGE",
"NO_CHANGE", "NO_CHANGE", "SET"]],
"COMPUTE_STATS")
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''**********************************************************************
Name: Assign Withheld Classification Flag to Outlier Points in LAS Files
Description: Uses Locate Outliers to identify points in LAS files that
should be assigned the 'withheld' classification flag.
Designed for use as a script tool.
**********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
try:
arcpy.CheckOutExtension('3D')
# Set Local Variables
lasD = arcpy.GetParameterAsText(0)
outliers = 'in_memory/outliers'
# Execute LocateOutliers
arcpy.ddd.LocateOutliers(lasD, outliers, 'APPLY_HARD_LIMIT', -10,
350, 'APPLY_COMPARISON_FILTER', 1.2, 120,
0.8, 8000)
# Execute SetLasClassCodeUsingFeatures
arcpy.ddd.SetLasClassCodesUsingFeatures(lasd, [["outliers.shp", 5,
"NO_CHANGE", "NO_CHANGE",
"NO_CHANGE", "SET"]])
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)