ArcGIS Pro 3.7 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 dataset 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 Function SearchPoints( _
       ByVal filter As LasPointFilter _
    ) As LasPointCursor
    public LasPointCursor SearchPoints( 
       LasPointFilter filter
    )

    Parameters

    filter
    Filter by parameters. See ArcGIS.Core.Data.Analyst3D.LasPointFilter. A null value will retrieve all points in the LAS dataset 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
    {
      // Note: Needs QueuedTask to run
      {
        // 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;
            //Use the point
          }
        }
    
        // 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;
            //Use the point
          }
        }
    
        // search within an extent and limited to specific classification 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;
            //Use the point
          }
        }
      }
    }
    Search using pre initialized arrays
    {
      // Note: Needs QueuedTask to run
      {
        // search all points and process with a set size of array retrieving only coordinates
        using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(null))
        {
          int count;
          Coordinate3D[] lasPointsRetrieved = new Coordinate3D[10000];
          while (ptCursor.MoveNextArray(lasPointsRetrieved, null, null, null, out count))
          {
            var points = lasPointsRetrieved.ToList();
    
            // Use the points
          }
        }
    
        // search within an extent
        // use MoveNextArray retrieving coordinates, fileIndex and pointIds
        ArcGIS.Core.Data.Analyst3D.LasPointFilter filter = new ArcGIS.Core.Data.Analyst3D.LasPointFilter();
        filter.FilterGeometry = envelope;
        using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDatasetLayer.SearchPoints(filter))
        {
          int count;
          Coordinate3D[] lasPointsRetrieved = new Coordinate3D[50000];
          int[] fileIndexes = new int[50000];
          double[] pointIds = new double[50000];
          while (ptCursor.MoveNextArray(lasPointsRetrieved, null, fileIndexes, pointIds, out count))
          {
            var points = lasPointsRetrieved.ToList();
            //Use the points
          }
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also