ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / SurfaceRendererTarget Enumeration
Example Example

In This Topic
    SurfaceRendererTarget Enumeration
    In This Topic
    Specifies a valid list of renderer categories that a ArcGIS.Core.CIM.CIMTinRenderer might be applicable for. See SurfaceLayer.CanSetRenderer and SurfaceLayer.SetRenderer.
    Syntax
    Members
    MemberDescription
    Contours Contours.
    DirtyArea Dirty Area.
    Edges Edges.
    Points Points or Nodes.
    Surface Surfaces or Faces.
    Example
    Create a TinLayer with renderers
    //Must be on the QueuedTask.Run()
    
    var tinCP_renderers = new TinLayerCreationParams(tinDataset);
    tinCP_renderers.Name = "My TIN layer";
    tinCP_renderers.IsVisible = true;
    
    // define the node renderer - use defaults
    var node_rd = new TinNodeRendererDefinition();
    
    // define the face/surface renderer
    var face_rd = new TinFaceClassBreaksRendererDefinition();
    face_rd.ClassificationMethod = ClassificationMethod.NaturalBreaks;
    // accept default color ramp, breakCount
    
    // set up the renderer dictionary
    var rendererDict = new Dictionary<SurfaceRendererTarget, TinRendererDefinition>();
    rendererDict.Add(SurfaceRendererTarget.Points, node_rd);
    rendererDict.Add(SurfaceRendererTarget.Surface, face_rd);
    
    // assign the dictionary to the creation params
    tinCP_renderers.RendererDefinitions = rendererDict;
    
    // create the layer
    var tinLayer_rd = LayerFactory.Instance.CreateLayer<TinLayer>(tinCP_renderers, MapView.Active.Map);
    Create a TerrainLayer with renderers
    //Must be on the QueuedTask.Run()
    
    var terrainCP_renderers = new TerrainLayerCreationParams(terrain);
    terrainCP_renderers.Name = "My LAS Layer";
    terrainCP_renderers.IsVisible = true;
    
    // define the edge type renderer - use defaults
    var edgeRD = new TinBreaklineRendererDefinition();
    
    // define the face/surface renderer
    var faceRD = new TinFaceClassBreaksRendererDefinition();
    faceRD.ClassificationMethod = ClassificationMethod.NaturalBreaks;
    // accept default color ramp, breakCount
    
    // define the dirty area renderer - use defaults
    var dirtyAreaRD = new TerrainDirtyAreaRendererDefinition();
    
    // add renderers to dictionary
    var t_dict = new Dictionary<SurfaceRendererTarget, TinRendererDefinition>();
    t_dict.Add(SurfaceRendererTarget.Edges, edgeRD);
    t_dict.Add(SurfaceRendererTarget.Surface, faceRD);
    t_dict.Add(SurfaceRendererTarget.DirtyArea, dirtyAreaRD);
    
    // assign dictionary to creation params
    terrainCP_renderers.RendererDefinitions = t_dict;
    
    //Create the layer to the terrain
    var terrainLayer_rd = LayerFactory.Instance.CreateLayer<TerrainLayer>(terrainCP_renderers, 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);
    
    Get Renderers
    // get the list of renderers
    IReadOnlyList<CIMTinRenderer> renderers = surfaceLayer.GetRenderers();
    
    // get the renderers as a dictionary
    Dictionary<SurfaceRendererTarget, CIMTinRenderer> dict = surfaceLayer.GetRenderersAsDictionary();
    Simple Node Renderer
    // applies to TIN layers only
    
    var nodeRendererDef = new TinNodeRendererDefinition();
    nodeRendererDef.Description = "Nodes";
    nodeRendererDef.Label = "Nodes";
    nodeRendererDef.SymbolTemplate = nodeSymbol.MakeSymbolReference();
    
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    if (tinLayer == null)
      return;
    
    if (tinLayer.CanCreateRenderer(nodeRendererDef))
    {
      CIMTinRenderer renderer = tinLayer.CreateRenderer(nodeRendererDef);
      if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    Elevation Node Renderer - Equal Breaks
    // applies to TIN layers only
    
    var equalBreaksNodeRendererDef = new TinNodeClassBreaksRendererDefinition();
    equalBreaksNodeRendererDef.BreakCount = 7;
    
    if (tinLayer.CanCreateRenderer(equalBreaksNodeRendererDef))
    {
      CIMTinRenderer renderer = tinLayer.CreateRenderer(equalBreaksNodeRendererDef);
      if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges))
        tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges);
    }
    
    Elevation Node Renderer - Defined Interval
    // applies to TIN layers only
    
    var defiendIntervalNodeRendererDef = new TinNodeClassBreaksRendererDefinition();
    defiendIntervalNodeRendererDef.ClassificationMethod = ClassificationMethod.DefinedInterval;
    defiendIntervalNodeRendererDef.IntervalSize = 4;
    defiendIntervalNodeRendererDef.SymbolTemplate = nodeSymbol.MakeSymbolReference();
    
    if (tinLayer.CanCreateRenderer(defiendIntervalNodeRendererDef))
    {
      CIMTinRenderer renderer = tinLayer.CreateRenderer(defiendIntervalNodeRendererDef);
      if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges))
        tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges);
    }
    Elevation Node Renderer - Standard Deviation
    // applies to TIN layers only
    
    var stdDevNodeRendererDef = new TinNodeClassBreaksRendererDefinition();
    stdDevNodeRendererDef.ClassificationMethod = ClassificationMethod.StandardDeviation;
    stdDevNodeRendererDef.DeviationInterval = StandardDeviationInterval.OneHalf;
    stdDevNodeRendererDef.ColorRamp = ColorFactory.Instance.GetColorRamp("Cyan to Purple");
    
    if (tinLayer.CanCreateRenderer(stdDevNodeRendererDef))
    {
      CIMTinRenderer renderer = tinLayer.CreateRenderer(stdDevNodeRendererDef);
      if (tinLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges))
        tinLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges);
    }
    
    Simple Edge Renderer
    // applies to TIN or LAS dataset layers only
    
    var edgeRendererDef = new TinEdgeRendererDefintion();
    edgeRendererDef.Description = "Edges";
    edgeRendererDef.Label = "Edges";
    edgeRendererDef.SymbolTemplate = lineSymbol.MakeSymbolReference();
    
    if (surfaceLayer.CanCreateRenderer(edgeRendererDef))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(edgeRendererDef);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges);
    }
    Edge Type Renderer
    var breaklineRendererDef = new TinBreaklineRendererDefinition();
    // use default symbol for regular edge but specific symbols for hard,soft,outside
    breaklineRendererDef.HardEdgeSymbol = hardEdgeSymbol.MakeSymbolReference();
    breaklineRendererDef.SoftEdgeSymbol = softEdgeSymbol.MakeSymbolReference();
    breaklineRendererDef.OutsideEdgeSymbol = outsideEdgeSymbol.MakeSymbolReference();
    
    if (surfaceLayer.CanCreateRenderer(breaklineRendererDef))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(breaklineRendererDef);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Edges))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Edges);
    }
    Contour Renderer
    var contourDef = new TinContourRendererDefinition();
    
    // now customize with a symbol
    contourDef.Label = "Contours";
    contourDef.SymbolTemplate = contourLineSymbol.MakeSymbolReference();
    contourDef.ContourInterval = 6;
    
    contourDef.IndexLabel = "Index Contours";
    contourDef.IndexSymbolTemplate = indexLineSymbol.MakeSymbolReference();
    contourDef.ContourFactor = 4;
    contourDef.ReferenceHeight = 7;
    
    if (surfaceLayer.CanCreateRenderer(contourDef))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(contourDef);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Contours))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Contours);
    }
    
    Simple Face Renderer
    var simpleFaceRendererDef = new TinFaceRendererDefinition();
    simpleFaceRendererDef.SymbolTemplate = polySymbol.MakeSymbolReference();
    
    if (surfaceLayer.CanCreateRenderer(simpleFaceRendererDef))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(simpleFaceRendererDef);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface);
    }
    Aspect Face Renderer
    var aspectFaceRendererDef = new TinFaceClassBreaksAspectRendererDefinition();
    aspectFaceRendererDef.SymbolTemplate = polySymbol.MakeSymbolReference();
    // accept default color ramp
    
    if (surfaceLayer.CanCreateRenderer(aspectFaceRendererDef))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(aspectFaceRendererDef);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface);
    }
    Slope Face Renderer - Equal Interval
    var slopeFaceClassBreaksEqual = new TinFaceClassBreaksRendererDefinition(TerrainDrawCursorType.FaceSlope);
    // accept default breakCount, symbolTemplate, color ramp
    
    if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksEqual))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksEqual);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface);
    }
    Slope Face Renderer - Quantile
    var slopeFaceClassBreaksQuantile = new TinFaceClassBreaksRendererDefinition(TerrainDrawCursorType.FaceSlope);
    slopeFaceClassBreaksQuantile.ClassificationMethod = ClassificationMethod.Quantile;
    // accept default breakCount, symbolTemplate, color ramp
    
    if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksQuantile))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksQuantile);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface);
    }
    Elevation Face Renderer - Equal Interval
    var elevFaceClassBreaksEqual = new TinFaceClassBreaksRendererDefinition();
    // accept default breakCount, symbolTemplate, color ramp
    
    if (surfaceLayer.CanCreateRenderer(slopeFaceClassBreaksEqual))
    {
      CIMTinRenderer renderer = surfaceLayer.CreateRenderer(slopeFaceClassBreaksEqual);
      if (surfaceLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Surface))
        surfaceLayer.SetRenderer(renderer, SurfaceRendererTarget.Surface);
    }
    Dirty Area Renderer
    // applies to Terrain layers only
    
    var dirtyAreaRendererDef = new TerrainDirtyAreaRendererDefinition();
    // accept default labels, symbolTemplate
    
    var terrainLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TerrainLayer>().FirstOrDefault();
    if (terrainLayer == null)
      return;
    
    if (terrainLayer.CanCreateRenderer(dirtyAreaRendererDef))
    {
      CIMTinRenderer renderer = terrainLayer.CreateRenderer(dirtyAreaRendererDef);
      if (terrainLayer.CanSetRenderer(renderer, SurfaceRendererTarget.DirtyArea))
        terrainLayer.SetRenderer(renderer, SurfaceRendererTarget.DirtyArea);
    }
    Terrain Point Class Breaks Renderer
    // applies to Terrain layers only
    
    var terrainPointClassBreaks = new TerrainPointClassBreaksRendererDefinition();
    // accept defaults
    
    if (terrainLayer.CanCreateRenderer(terrainPointClassBreaks))
    {
      CIMTinRenderer renderer = terrainLayer.CreateRenderer(terrainPointClassBreaks);
      if (terrainLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        terrainLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    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);
    }
    LAS Points Returns Unique Value Renderer
    // applies to LAS dataset layers only
    
    var lasPointsReturnsRendererDef = new LasUniqueValueRendererDefinition(LasAttributeType.ReturnNumber);
    lasPointsReturnsRendererDef.ModulateUsingIntensity = true;
    lasPointsReturnsRendererDef.SymbolScaleFactor = 1.0;
    // accept the defaults for color ramp, symbolTemplate
    
    if (lasDatasetLayer.CanCreateRenderer(lasPointsReturnsRendererDef))
    {
      CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsReturnsRendererDef);
      if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    LAS Points Elevation Stretch Renderer
    // applies to LAS dataset layers only
    
    var elevLasStretchRendererDef = new LasStretchRendererDefinition(ArcGIS.Core.CIM.LASStretchAttribute.Elevation);
    // accept the defaults for color ramp, etc
    
    if (lasDatasetLayer.CanCreateRenderer(elevLasStretchRendererDef))
    {
      CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(elevLasStretchRendererDef);
      if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    
    
    // OR use a stretch renderer with stretchType standard Deviations
    var elevLasStretchStdDevRendererDef = new LasStretchRendererDefinition(ArcGIS.Core.CIM.LASStretchAttribute.Elevation);
    elevLasStretchStdDevRendererDef.StretchType = LASStretchType.StandardDeviations;
    elevLasStretchStdDevRendererDef.NumberOfStandardDeviations = 2;
    // accept the defaults for color ramp,  etc
    
    if (lasDatasetLayer.CanCreateRenderer(elevLasStretchStdDevRendererDef))
    {
      CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(elevLasStretchStdDevRendererDef);
      if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    LAS Points Classified Elevation Renderer
    // applies to LAS dataset layers only
    
    var lasPointsClassBreaksRendererDef = new LasPointClassBreaksRendererDefinition();
    lasPointsClassBreaksRendererDef.ClassificationMethod = ClassificationMethod.NaturalBreaks;
    lasPointsClassBreaksRendererDef.ModulateUsingIntensity = true;
    // increase the symbol size by a factor
    lasPointsClassBreaksRendererDef.SymbolScaleFactor = 1.0;
    
    if (lasDatasetLayer.CanCreateRenderer(lasPointsClassBreaksRendererDef))
    {
      CIMTinRenderer renderer = lasDatasetLayer.CreateRenderer(lasPointsClassBreaksRendererDef);
      if (lasDatasetLayer.CanSetRenderer(renderer, SurfaceRendererTarget.Points))
        lasDatasetLayer.SetRenderer(renderer, SurfaceRendererTarget.Points);
    }
    Remove an edge renderer
    var layer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<SurfaceLayer>().FirstOrDefault();
    if (layer == null)
      return;
    
    QueuedTask.Run(() =>
    {
      layer.RemoveRenderer(SurfaceRendererTarget.Edges);
    });
    
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Desktop.Mapping.SurfaceRendererTarget

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also