ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / LasPointFilter Class / FilterGeometry Property
Example

In This Topic
    FilterGeometry Property (LasPointFilter)
    In This Topic
    Gets and sets a geometry filter. It may be set to an ArcGIS.Core.Geometry.Envelope or a ArcGIS.Core.Geometry.Polygon. Default value is null.
    Syntax
    public Geometry FilterGeometry {get; set;}
    Public Property FilterGeometry As Geometry
    Remarks
    If no geometry is specified, then all points are considered for inclusion by the filter. Otherwise only points inside the geometry are considered for inclusion by the filter. If specified, this will be projected into the spatial reference of the LAS dataset. The Z range, if set, is ignored.
    Example
    Search LAS Points
    // search all points
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDataset.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 = lasDataset.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    // 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 = lasDataset.SearchPoints(pointFilter))
    {
      while (ptCursor.MoveNext())
      {
        using (ArcGIS.Core.Data.Analyst3D.LasPoint point = ptCursor.Current)
        {
    
        }
      }
    }
    
    Search using pre initialized arrays
    // search all points
    using (ArcGIS.Core.Data.Analyst3D.LasPointCursor ptCursor = lasDataset.SearchPoints(null))
    {
      int count;
      Coordinate3D[] lasPointsRetrieved = new Coordinate3D[10000];
      while (ptCursor.MoveNextArray(lasPointsRetrieved, null, null, null, out count))
      {
        var points = lasPointsRetrieved.ToList();
      
        // ...
      }
    }
    
    // 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 = lasDataset.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();
    
      }
    }
          
    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 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)
        {
    
        }
      }
    }
    
    Search using pre initialized arrays
    // 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();
    
        // ...
      }
    }
    
    // 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();
    
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also