Colorize LAS (3D Analyst)

Summary

Applies colors and near-infrared values from orthographic imagery to LAS points.

Illustration

Colorize LAS

Usage

  • Displaying LAS points using RGB information can provide an immersive, photorealistic display that delivers a unique display experience. The visual feedback of true imagery superimposed onto LAS points can provide insight about the discrete characteristics of the point cloud that can be helpful when interactively classifying the data, digitizing new features, and establishing a reference point when taking 3D distance measurements.

  • The best imagery to use for applying colors to LAS points would be sourced from the same time as the lidar survey to achieve the best match with the features being captured. Lacking that, you would want to try using imagery that is as close to the scan date as possible to minimize differences due to events such as construction or the seasonal variation of deciduous leaves.

  • If your source imagery is composed of numerous tiled images, consider loading those tiles into a mosaic dataset to reference them as a single dataset and use it as the image input for colorizing your LAS data. Learn more about creating a mosaic dataset.

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

  • When a processing extent is defined, the entire LAS file that intersects the processing extent will be colorized. If only a subset of the input LAS file is desired, consider using the Extract LAS tool to clip out the subset, and use the resulting file as the input for this tool.

  • It is not uncommon for LAS point records to be stored in the LAS file in a binary sequence that does not correspond with the spatial clustering of the points. When data of such distribution is queried, it can result in less efficient access to the binary records that represent the LAS points. Rearranging the points in the resulting LAS file will optimize the data for visualization and other spatial operations. Statistics will automatically be calculated when the rearrange option is enabled. If you choose not to rearrange the LAS points, then you can elect to enable or disable the calculation of statistics. Calculating statistics will optimize spatial queries and provide a summary of the class codes and return values that are present in the LAS file. However, it will also add time to the processing of this tool. If the resulting LAS files will not be used in ArcGIS, you may elect to disable the calculation of statistics so that the tool can execute faster.

Syntax

arcpy.3d.ColorizeLas(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.

Mosaic Layer; Raster Layer
bands
[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 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.

  • 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 near-infrared values. This is only available for LAS version 1.4.
Long
compression
(Optional)

Specifies whether the output LAS file will in a compressed format or 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.

  • NO_REARRANGE_POINTSThe order of the points in the LAS files will remain the same.
  • REARRANGE_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. 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_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

Derived Output

NameExplanationData Type
output_folder

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

Folder

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

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

Related topics