ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / PointCloudSceneLayer Class / GetAvailableClassCodesAndLabels Method
Example

In This Topic
    GetAvailableClassCodesAndLabels Method
    In This Topic
    Gets the available classification codes and their corresponding labels. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Dictionary<int,string> GetAvailableClassCodesAndLabels()
    Public Function GetAvailableClassCodesAndLabels() As Dictionary(Of Integer,String)

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Remarks
    Classification codes are used to define the type of surface, or surfaces, that reflected the lidar pulse. Classification codes are used in a PointCloudFilterDefinition to filter which point cloud data is rendered (or not)
    Example
    Query all class codes and lables in the PointCloudSceneLayer
    //Must be called on the MCT
    //var pcsl = ...;
    //At 2.x - Dictionary<int, string> classCodesAndLabels =
    //                    pcsl.QueryAvailableClassCodesAndLabels();
    
    Dictionary<int, string> classCodesAndLabels = 
                    pcsl.GetAvailableClassCodesAndLabels();
    Set a Filter for PointCloudSceneLayer
    //Must be called on the MCT
    //var pcsl = ...;
    //Retrieve the available classification codes
    //At 2.x - var dict = pcsl.QueryAvailableClassCodesAndLabels();
    var dict = pcsl.GetAvailableClassCodesAndLabels();
    
    //Filter out low noise and unclassified (7 and 1 respectively)
    //consult https://pro.arcgis.com/en/pro-app/help/data/las-dataset/storing-lidar-data.htm
    var filterDef = new PointCloudFilterDefinition()
    {
      ClassCodes = dict.Keys.Where(c => c != 7 && c != 1).ToList(),
      ReturnValues = new List<PointCloudReturnType> { 
                             PointCloudReturnType.FirstOfMany }
    };
    //apply the filter
    pcsl.SetFilters(filterDef.ToCIM());
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also