Skip To Content

Colorize LAS

Summary

Creates new LAS files with RGB and infrared values using existing LAS files and imagery.

Usage

  • This tool is suited for applying colors from orthographic imagery to lidar returns collected from an aerial survey. It does not provide support oblique imagery which has not been orthorectified.

  • Only LAS file version 1.4 with point record format 8 supports the storage of infrared values for LAS points.

Syntax

ColorizeLas_3d (in_las_dataset, in_image, bands, target_folder, {name_suffix}, {las_version}, {point_format}, {compression}, {rearrange_points}, {compute_stats}, {out_las_dataset})
ParameterExplanationData Type
in_las_dataset

The LAS dataset to process.

LAS Dataset Layer
in_image

The image that will be used to assign colors to LAS points.

Raster Layer
bands

The bands from the input image that will be assigned to the color channels associated with the output LAS points.

Value Table
target_folder

The existing folder that the output LAS files will be written out to.

Folder
name_suffix
(Optional)

The text that will be appended to the name of each output LAS file. Each file will inherit its base name from its source file, followed by the suffix specified in this parameter.

String
las_version
(Optional)

The LAS version of the output files being created.

  • 1.2LAS file version 1.2 will be created.
  • 1.3LAS file version 1.3 will be created.
  • 1.4LAS file version 1.4 will be created. This is the default.
String
point_format
(Optional)

The point record format of the output LAS files. Only LAS 1.4 files

  • 2Point record format 2.
  • 3Point record format 3 supports the storage of GPS time.
  • 7Point record format 7. This is the default value, and is only available for LAS version 1.4
  • 8Point record format 8 supports the storage of infrared values. This is only available for LAS version 1.4.
Long
compression
(Optional)

Specify if the output LAS file will be compressed format or in the standard LAS format.

  • NO_COMPRESSIONThe output will be in the standard LAS format (*.las). This is the default.
  • ZLASOutput LAS files will be compressed in the zLAS format.
String
rearrange_points
(Optional)

Determines whether to rearrange points in the LAS files.

  • REARRANGE_POINTSThe order of the points in the LAS files will remain the same.
  • MAINTAIN_POINTSThe points in the LAS files will be rearranged. This is the default.
Boolean
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.

  • COMPUTE_STATSStatistics will be computed.
  • NO_COMPUTE_STATSStatistics will not be computed. This is the default.
Boolean
out_las_dataset
(Optional)

The output LAS dataset referencing the newly created LAS files.

LAS Dataset

Code sample

ColorizeLas example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window.

arcpy.env.workspace = 'C:/data'
arcpy.ddd.ColorizeLas('2014_lidar_survey.lasd', '2014_CIR.tif', 
                      'RED Band_1; GREEN Band_2; BLUE Band_3', 
                      'las/rgb', '_rgb', 1.3, 3, 'ZLAS', 
                      'REARRANGE_POINTS')
ColorizeLas example 2 (stand-alone script)

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

'''****************************************************************************
       Name: Classify Lidar & Extract Building Footprints
Description: Extract footprint from lidar points classified as buildings, 
             regularize its geometry, and calculate the building height.

****************************************************************************'''
import arcpy

lasd = arcpy.GetParameterAsText(0)
dem = arcpy.GetParameterAsText(1)
footprint = arcpy.GetParameterAsText(2)

try:
    desc = arcpy.Describe(lasd)
    if desc.spatialReference.linearUnitName in ['Foot_US', 'Foot']:
        unit = 'Feet'
    else:
        unit = 'Meters'
    ptSpacing = desc.pointSpacing * 2.25
    sampling = '{0} {1}'.format(ptSpacing, unit)
    # Classify overlap points
    arcpy.ddd.ClassifyLASOverlap(lasd, sampling)
    # Classify ground points
    arcpy.ddd.ClassifyLasGround(lasd)
    # Filter for ground points
    arcpy.management.MakeLasDatasetLayer(lasd, 'ground', class_code=[2])
    # Generate DEM
    arcpy.conversion.LasDatasetToRaster('ground', dem, 'ELEVATION', 
                                        'BINNING NEAREST NATURAL_NEIGHBOR', 
                                        sampling_type='CELLSIZE', 
                                        sampling_value=desc.pointSpacing)
    # Classify noise points
    arcpy.ddd.ClassifyLasNoise(lasd, method='ISOLATION', edit_las='CLASSIFY', 
                               withheld='WITHHELD', ground=dem, 
                               low_z='-2 feet', high_z='300 feet', 
                               max_neighbors=ptSpacing, step_width=ptSpacing, 
                               step_height='10 feet')
    # Classify buildings
    arcpy.ddd.ClassifyLasBuilding(lasd, '7.5 feet', '80 Square Feet')
    #Classify vegetation
    arcpy.ddd.ClassifyLasByHeight(lasd, 'GROUND', [8, 20, 55], 
                                  compute_stats='COMPUTE_STATS')
    # Filter LAS dataset for building points
    lasd_layer = 'building points'
    arcpy.management.MakeLasDatasetLayer(lasd, lasd_layer, class_code=[6])
    # Export raster from lidar using only building points
    temp_raster = 'in_memory/bldg_raster'
    arcpy.management.LasPointStatsAsRaster(lasd_layer, temp_raster,
                                           'PREDOMINANT_CLASS', 'CELLSIZE', 2.5)
    # Convert building raster to polygon
    temp_footprint = 'in_memory/footprint'
    arcpy.conversion.RasterToPolygon(temp_raster, temp_footprint)
    # Regularize building footprints
    arcpy.ddd.RegularizeBuildingFootprint(temp_footprint, footprint, 
                                          method='RIGHT_ANGLES')

except arcpy.ExecuteError:
    print(arcpy.GetMessages())

Licensing information

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

Related topics