ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LineOfSightResult Class
Members Example

In This Topic
    LineOfSightResult Class
    In This Topic
    A class to contain the results of running SurfaceLayer.GetLineOfSight
    Object Model
    LineOfSightResult ClassPolyline ClassMapPoint ClassPolyline Class
    public class LineOfSightResult 
    Public Class LineOfSightResult 
    The output line of sight is divided into visible and invisible portions along the input sight line running from the LineOfSightParams.ObserverPoint to the LineOfSightParams.TargetPoint.
    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;
      if (tinLayer.CanGetLineOfSight(losParams))
        results = tinLayer.GetLineOfSight(losParams);
    catch (Exception ex)
      // log exception message
    if (results != null)
      bool targetIsVisibleFromObserverPoint = results.IsTargetVisibleFromObserverPoint;
      bool targetVisibleFromVisibleLine = results.IsTargetVisibleFromVisibleLine;
      bool targetVisibleFromInVisibleLine = 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



    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also