ArcGIS Pro 3.6 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LasPointSelectionFilter Class / ClassCodes Property
Example

In This Topic
    ClassCodes Property (LasPointSelectionFilter)
    In This Topic
    Gets or sets the list of classification codes to be used in the selection filter.
    Syntax
    public List<int> ClassCodes {get; set;}
    Public Property ClassCodes As List(Of Integer)
    Remarks
    Use null to indicate you don't wish to change any of the existing classification codes used to define selectable LAS points. Use an empty list to indicate you wish to specify all classification codes to define selectable LAS points. Specify specific classification codes to defined selectable LAS points.
    Example
    Select using LasPointSelectionFilter
    // must be on MCT 
    
    // create the filter
    var filter = new LasPointSelectionFilter();
    // set the filter geometry
    // don't set VisiblePoints, ClassCodes - use the existing layer values
    filter.FilterGeometry = geometry;
    
    // perform the selection
    var selCount = await lasDatasetLayer.SelectAsync(filter, SelectionCombinationMethod.New);
    
    // set up a second filter and configure the VisiblePoints, ClassCodes
    // note that the ClassCodes is using only (4,5)
    // whereas the layers setting is (3,4,5)
    var filter2 = new LasPointSelectionFilter();
    filter2.VisiblePoints = true;
    filter2.ClassCodes = new List<int>() { 4, 5 };
    filter2.FilterGeometry = geometry;
    
    // perform the selection
    selCount = await lasDatasetLayer.SelectAsync(filter2, SelectionCombinationMethod.New);
    Select using LasPointClusterSelectionFilter
    // must be on MCT 
    
    var clusterFilter = new LasPointClusterSelectionFilter();
    clusterFilter.VisiblePoints = true;
    clusterFilter.ClassCodes = new List<int>();  // empty list means all classification codes
    clusterFilter.FilterGeometry = geometry;
    
    clusterFilter.SearchRadius = 0.5; // meters
    clusterFilter.MaximumNumberOfPoints = 500;
    
    var clusterSelCount = await lasDatasetLayer.SelectAsync(clusterFilter, SelectionCombinationMethod.New);
    
    Select using LasPointPlaneSelectionFilter
    // must be on MCT 
    
    var planeFilter = new LasPointPlaneSelectionFilter();
    planeFilter.VisiblePoints = true;
    planeFilter.ClassCodes = new List<int>();  // empty list means all classification codes
    planeFilter.FilterGeometry = geometry;
    
    planeFilter.ClusteringDistance = 0.3; // meters
    planeFilter.MaximumDistance = 500;
    planeFilter.PlaneTolerance = 0.152; // meters
    
    var planeSelCount = await lasDatasetLayer.SelectAsync(planeFilter, SelectionCombinationMethod.New);
    
    Select using LasPointRailSelectionFilter
    // must be on MCT 
    
    var railFilter = new LasPointRailSelectionFilter();
    railFilter.VisiblePoints = true;
    railFilter.ClassCodes = new List<int>();  // empty list means all classification codes
    railFilter.FilterGeometry = geometry;
    
    // configure a few of the properties and accept defaults for others
    railFilter.SearchRadius = 0.5; // meters
    railFilter.RailThickness = 0.2; // meters
    railFilter.MaximumLength = 225; // meters
    
    var railSelCount = await lasDatasetLayer.SelectAsync(railFilter, SelectionCombinationMethod.New);
    Select using LasPointPipelineSelectionFilter
    // must be on MCT 
    
    var pipelineFilter = new LasPointPipelineSelectionFilter();
            
    pipelineFilter.VisiblePoints = true;
    pipelineFilter.ClassCodes = new List<int>();  // empty list means all classification codes
    pipelineFilter.FilterGeometry = geometry;
    
    // configure a few of the properties and accept defaults for others
    pipelineFilter.ApplyWindCorrection = true;
    pipelineFilter.MinimumLength = 25;  // meters
    
    var pipelineSelCount = await lasDatasetLayer.SelectAsync(pipelineFilter, SelectionCombinationMethod.New);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.6 or higher.
    See Also