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

In This Topic
    LineOfSightParams Class
    In This Topic
    A class to contain the input values for SurfaceLayer.GetLineOfSight.
    Object Model
    LineOfSightParams ClassMapPoint ClassSpatialReference ClassMapPoint Class
    Syntax
    public class LineOfSightParams 
    Public Class LineOfSightParams 
    Example
    Get Line of Sight
    var losParams = new LineOfSightParams();
    losParams.ObserverPoint = observerPoint;
    losParams.TargetPoint = targetPoint;
    
    // add offsets if appropriate
    // losParams.ObserverHeightOffset = observerOffset;
    // losParams.TargetHeightOffset = targerOffset;
    
    // set output spatial reference
    losParams.OutputSpatialReference = MapView.Active.Map.SpatialReference;
    
    LineOfSightResult results = null;
    try
    {
      if (tinLayer.CanGetLineOfSight(losParams))
        results = tinLayer.GetLineOfSight(losParams);
    }
    catch (Exception ex)
    {
      // log exception message
    }
    
    if (results != null)
    {
      bool targetIsVisibleFromObserverPoint = results.IsTargetVisibleFromObserverPoint;
      //These properties are not used. They will always be false
      // results.IsTargetVisibleFromVisibleLine;
      // results.IsTargetVisibleFromInvisibleLine;
    
    
      if (results.VisibleLine != null)
        MapView.Active.AddOverlay(results.VisibleLine, visibleLineSymbol.MakeSymbolReference());
      if (results.InvisibleLine != null)
        MapView.Active.AddOverlay(results.VisibleLine, invisibleLineSymbol.MakeSymbolReference());
      if (results.ObstructionPoint != null)
        MapView.Active.AddOverlay(results.ObstructionPoint, obstructionPointSymbol.MakeSymbolReference());
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Mapping.LineOfSightParams

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also