ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Change LAS Class Codes

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Reassigns the classification codes and flags of LAS files.

Usage

  • All LAS files referenced by the LAS dataset will be evaluated by this tool, but only the files that contain the provided class codes will be modified.

  • Consider using this tool to update the classification of data points in LAS files generated prior to the introduction of standardized class codes in the LAS 1.1 specifications.

  • The LAS format supports the classification of each point based on the specifications defined by the American Society for Photogrammetry and Remote Sensing (ASPRS). The ArcGIS platform applies the classification scheme specified for LAS file version 1.4:

    Classification Value Classification Type

    0

    Never Classified

    1

    Unassigned

    2

    Ground

    3

    Low Vegetation

    4

    Medium Vegetation

    5

    High Vegetation

    6

    Building

    7

    Low Noise

    8

    Model Key / Reserved

    9

    Water

    10

    Rail

    11

    Road Surface

    12

    Overlap / Reserved

    13

    Wire – Guard

    14

    Wire – Conductor

    15

    Transmission Tower

    16

    Wire – Connector

    17

    Bridge Deck

    18

    High Noise

    19 – 63

    Reserved for ASPRS Definition (LAS 1.1 to 1.3 support up to class code 31)

    32 – 255

    User Definable (Only supported in LAS 1.0 and certain versions of 1.4)

Syntax

arcpy.ddd.ChangeLasClassCodes(in_las_dataset, class_codes, {compute_stats}, {extent}, boundary, {process_entire_files})
ParameterExplanationData Type
in_las_dataset

The LAS dataset to process.

LAS Dataset Layer
class_codes
[[current_class, new_class],...]

Specify each pair of current and new class code values as a space-delimited string or a list of integers. For example, a current class code of 5 can be changed to 2 by specifying "5 2" or [5, 2]. Multiple class codes can be entered as a semicolon-delimited string ("5 2; 8 3; 1 4"), a list of strings (for example, [[5, 2], [8, 3], [1, 4]]).

Value Table
compute_stats
(Optional)

Specifies whether statistics should be computed for the LAS files referenced by the LAS dataset. Computing statistics provides a spatial index for each LAS file, which improves analysis and display performance. Statistics also enhance the filtering and symbology experience by limiting the display of LAS attributes, like classification codes and return information, to values that are present in the LAS file.

  • COMPUTE_STATS —Statistics will be computed.
  • NO_COMPUTE_STATS —Statistics will not be computed. This is the default.
Boolean
extent
(Optional)

Specifies the extent of the data that will be evaluated by this tool.

Extent
boundary

A polygon feature that defines the area of interest to be processed by this tool.

Feature Layer
process_entire_files
(Optional)

Specifies how the processing extent is applied.

  • PROCESS_EXTENT —Only LAS points that intersect the area of interest will be processed. This is the default.
  • PROCESS_ENTIRE_FILES —If any portion of a LAS file intersects the area of interest, all the points in that LAS file, including those outside the area of interest, will be processed.
Boolean

Derived Output

NameExplanationData Type
derived_las_dataset

The updated LAS dataset.

LAS Dataset Layer

Code sample

ChangeLasClassCodes example 1 (Python window)

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.ChangeLasClassCodes_3d('test.lasd', [[5, 2], [3, 1], [4, 6]], 
                           'COMPUTE_STATS')
ChangeLasClassCodes example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script.

'''****************************************************************************
Name: Update LAS 1.0 Classification to ASPRS 1.1 Specs
Description: Updates classification of version 1.0 LAS files to conform to 
             the standardized class codes introduced in the 1.1 specifications. 
             The code is designed for use as a script tool.
****************************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback

# Set Local Variables
inLas = arcpy.GetParameterAsText(0)
recursion = arcpy.GetParameterAsText(1)
lasd = arcpy.GetParameterAsText(2)
reclassList = arcpy.GetParameterAsText(3) #List of values '<oldCode> <newCode>'
calcStats = arcpy.GetParameter(4)

try:
    arcpy.CheckOutExtension('3D')
    # Execute CreateLasDataset
    arcpy.management.CreateLasDataset(inLas, lasd, recursion)
    # Execute ChangeLasClassCodes
    arcpy.ddd.ChangeLasClassCodes(lasd, reclassList, calcStats)
    # Report messages
    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)

Environments

  • Current Workspace
  • Extent

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics

  • An overview of the Data Management toolset
  • Fundamentals of Surfaces
  • Surface formats
  • Lidar point classification
  • Editing LAS point classification
  • Working with LAS classification in ArcGIS

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal