ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LasDatasetLayer Class / SearchPoints Method
Filter by parameters. See ArcGIS.Core.Data.Analyst3D.LasPointFilter. A null value will retrieve all points in the LAS layer.
Example

In This Topic
    SearchPoints Method (LasDatasetLayer)
    In This Topic
    Retrieves the points in the LAS dataset layer that satisfy the criteria set in the filter. If no filter is set, all points will be retrieved. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public LasPointCursor SearchPoints( 
       LasPointFilter filter
    )
    Public Function SearchPoints( _
       ByVal filter As LasPointFilter _
    ) As LasPointCursor

    Parameters

    filter
    Filter by parameters. See ArcGIS.Core.Data.Analyst3D.LasPointFilter. A null value will retrieve all points in the LAS layer.

    Return Value

    Exceptions
    ExceptionDescription
    This method or property must be called within the lambda passed to QueuedTask.Run
    Remarks

    If there is an existing display filter set on the layer, the Search() method will work on the subset of points in the layer that meet the display filter definition criteria. The search filter will be applied after the LAS dataset layer's display filter.

    To ensure maximum robustness, callers should explicitly dispose of the returned ArcGIS.Core.Data.Analyst3D.LasPointCursor in either a using statement or a finally block.

    Example
    Search for LAS Points
    // searching on the LasDatasetLayer will honor any LasPointDisplayFilter
    
    // search all points
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(null))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent
    ArcGIS.Core.Data.Analyst3D.LasPointFilter pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // search within an extent and limited to specific classsification codes
    pointFilter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
    pointFilter.FilterGeometry = envelope;
    pointFilter.ClassCodes = new List<int> { 4, 5 };
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also