ArcGIS Pro 3.7 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 Property ClassCodes As List(Of Integer)
    public List<int> ClassCodes {get; set;}
    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 = polygon;
    
      // 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 = polygon;
    
      // 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 = polygon;
    
      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 = polygon;
    
      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 = polygon;
    
      // 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 = polygon;
    
      // 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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also