ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LineOfSightParams Class / LineOfSightParams Constructor / LineOfSightParams Constructor(MapPoint,MapPoint,Double,Double,Boolean,Boolean,Double,SpatialReference)
The observer point.
The target point.
The observer height offset.
The target height offset.
Apply curvature.
Apply refraction.
Refraction factor.
The output spatial reference.
Example

In This Topic
    LineOfSightParams Constructor(MapPoint,MapPoint,Double,Double,Boolean,Boolean,Double,SpatialReference)
    In This Topic
    Constructor overload. Initialize a new instance of LineOfSightParams.
    Syntax

    Parameters

    observerPoint
    The observer point.
    targetPoint
    The target point.
    observerHeightOffset
    The observer height offset.
    targetHeightOffset
    The target height offset.
    applyCurvature
    Apply curvature.
    applyRefraction
    Apply refraction.
    refractionFactor
    Refraction factor.
    outputSpatialReference
    The output spatial reference.
    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;
      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());
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also