Select to view content in your preferred language

Using a LAS non-core attribute to determine symbology

291
0
06-30-2023 01:43 PM
Labels (1)
DavidGodfrey2
New Contributor II

Hi there,

I have been using R Studio and LidR to segment Lidar LAS data into different trees, lidR only allows you to add an additional attribute to a the LAS file format and when viewed in ARCGIS PRo the additional 'non-core' attributes are not an option to determine the symbology of the LAS Feature Layer.

I am trying to symbolise a LAS layer by a non-core attribute called treeID and i am stumped!

I have been playing with a  Python Script to try and work around but it throws an error saying it needs to be a feature layer which LAS layer dont seemed to be.

here is the py script

 

import arcpy

# Set the input LAS dataset path
las_dataset = r"path/to/your/las_dataset.las"

# Set the non-core attribute field to use for colorization
color_attribute = "Your_Color_Field"

# Set the output feature class path
output_feature_class = r"path/to/your/output_feature_class.shp"

# Create a LAS dataset layer
las_layer = arcpy.management.MakeLasDatasetLayer(las_dataset, "las_layer")[0]

# Set the symbology for the LAS layer based on the color attribute
symbology = arcpy.mp.LayerFile(r"path/to/your/symbology.lyrx")
arcpy.management.ApplySymbologyFromLayer(las_layer, symbology)

# Create a feature class from the LAS layer with colorization
arcpy.conversion.FeatureClassFromLayer(las_layer, output_feature_class)

# Clean up the temporary LAS layer
arcpy.management.Delete(las_layer)

 

 

 

Tags (3)
0 Kudos
0 Replies