ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / RasterLayer Class / CanGetLineOfSight Method
A set of parameters that will be used to calculate the Line of Sight.

In This Topic
    CanGetLineOfSight Method (RasterLayer)
    In This Topic
    Determines whether a Line of Sight analysis can be calculated for the given set of parameters. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool CanGetLineOfSight( 
       LineOfSightParams lineOfSightParams
    )
    Public Function CanGetLineOfSight( _
       ByVal lineOfSightParams As LineOfSightParams _
    ) As Boolean

    Parameters

    lineOfSightParams
    A set of parameters that will be used to calculate the Line of Sight.

    Return Value

    True if checks pass. False otherwise.
    Remarks
    It is important to call this method prior to GetLineOfSight to ensure that a possible result can be found given the set of input parameters. In addition to checking for valid observer and target points (that is they have x,y coordinates) and non NaN observer height, target height and refraction factors, the observer and target points must also lie within the extent of the surface's area. this method also checks for a 3D Analyst license which is required to perform the analysis. Finally if LineOfSightParams.ApplyCurvature or LineOfSightParams.ApplyRefraction are set to true, then the spatial reference of the surface needs to be in a projected coordinate system and have Z coordinate units defined.

    Note that if this method returns true it does not preclude the GetLineOfSight method from throwing an exception due to a calculation error and callers should code defensively and use appropriate exception handling.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also