ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LasDatasetLayer Class
Members Example

In This Topic
    LasDatasetLayer Class
    In This Topic
    Represents a LAS dataset layer.
    Object Model
    LasDatasetLayer ClassCIMTinRenderer ClassCIMDataConnection ClassTimeExtent ClassCIMBaseLayer ClassLasPointDisplayFilter ClassElevationTypeDefinition ClassLasDataset ClassLineOfSightResult ClassSpatialReference ClassTimeParameters ClassSurfaceZsResult ClassMap ClassILayerContainer InterfaceEnvelope ClassLasPointCursor Class
    Syntax
    Example
    Retrieve layers
    // find the first TIN layer
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    
    // find the first Terrain layer
    var terrainLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TerrainLayer>().FirstOrDefault();
    
    // find the first LAS dataset layer
    var lasDatasetLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<LasDatasetLayer>().FirstOrDefault();
    
    // find the set of surface layers
    var surfacelayers = MapView.Active.Map.GetLayersAsFlattenedList().OfType<SurfaceLayer>();
    Create a LasDatasetLayer
    //Must be on the QueuedTask.Run()
    
    string lasPath = @"d:\Data\LASDataset.lasd";
    var lasURI = new Uri(lasPath);
    
    var lasCP = new LasDatasetLayerCreationParams(lasURI);
    lasCP.Name = "My LAS Layer";
    lasCP.IsVisible = false;
    
    //Create the layer to the LAS dataset
    var lasDatasetLayer = LayerFactory.Instance.CreateLayer<LasDatasetLayer>(lasCP, map);
    
    Create a LasDatasetLayer from a LasDataset
    //Must be on the QueuedTask.Run()
    
    var lasCP_ds = new LasDatasetLayerCreationParams(lasDataset);
    lasCP_ds.Name = "My LAS Layer";
    lasCP_ds.IsVisible = false;
    
    //Create the layer to the LAS dataset
    var lasDatasetLayer_ds = LayerFactory.Instance.CreateLayer<LasDatasetLayer>(lasCP_ds, map);
    
    Create a LasDatasetLayer with renderers
    //Must be on the QueuedTask.Run()
    
    var lasCP_renderers = new LasDatasetLayerCreationParams(lasDataset);
    lasCP_renderers.Name = "My LAS Layer";
    lasCP_renderers.IsVisible = false;
    
    // create a point elevation renderer
    var ptR = new LasStretchRendererDefinition();
    // accept all defaults
    
    // create a simple edge renderer
    var edgeR = new TinEdgeRendererDefintion();
    // accept all defaults
    
    // add renderers to dictionary
    var l_dict = new Dictionary<SurfaceRendererTarget, TinRendererDefinition>();
    l_dict.Add(SurfaceRendererTarget.Points, ptR);
    l_dict.Add(SurfaceRendererTarget.Edges, edgeR);
    
    // assign dictionary to creation params
    lasCP_renderers.RendererDefinitions = l_dict;
    
    //Create the layer to the LAS dataset
    var lasDatasetLayer_rd = LayerFactory.Instance.CreateLayer<LasDatasetLayer>(lasCP_renderers, map);
    
    LAS Points Classification Unique Value Renderer
    // applies to LAS dataset layers only
    
    var lasPointsClassificationRendererDef = new LasUniqueValueRendererDefinition(LasAttributeType.Classification);
    // accept the defaults for color ramp, symbolTemplate, symbol scale factor
    
    var lasDatasetLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<LasDatasetLayer>().FirstOrDefault();
    if (lasDatasetLayer == null)
      return;
    
    if (lasDatasetLayer.CanCreateRenderer(lasPointsClassificationRendererDef))
    {
      CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsClassificationRendererDef);
      if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Framework.Contracts.PropertyChangedBase
          ArcGIS.Desktop.Mapping.MapMember
             ArcGIS.Desktop.Mapping.Layer
                ArcGIS.Desktop.Mapping.SurfaceLayer
                   ArcGIS.Desktop.Mapping.LasDatasetLayer

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also