This document is archived and information here might be outdated.  Recommended version.


ISurface.GetLineOfSight Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IS > ISurface Interface > ISurface.GetLineOfSight Method
ArcGIS Developer Help

ISurface.GetLineOfSight Method

Computes the visibility of a line-of-sight from the observer to the target.

[Visual Basic .NET]
Public Sub GetLineOfSight ( _
    ByVal pObserver As IPoint, _
    ByVal pTarget As IPoint, _
    ByRef ppObstruction As IPoint, _
    ByRef ppVisibleLines As IPolyline, _
    ByRef ppInvisibleLines As IPolyline, _
    ByRef pbIsVisible As Boolean, _
    ByVal bApplyCurvature As Boolean, _
    ByVal bApplyRefraction As Boolean, _
    [ByRef pRefractionFactor As Object] _
)
[C#]
public void GetLineOfSight (
    IPoint pObserver,
    IPoint pTarget,
    ref IPoint ppObstruction,
    ref IPolyline ppVisibleLines,
    ref IPolyline ppInvisibleLines,
    ref bool pbIsVisible,
    ref bool bApplyCurvature,
    ref bool bApplyRefraction,
    ref object pRefractionFactor
);
[C++]
HRESULT GetLineOfSight(
  IPoint* pObserver,
  IPoint* pTarget,
  IPoint** ppObstruction,
  IPolyline** ppVisibleLines,
  IPolyline** ppInvisibleLines,
  Boolean* pbIsVisible,
  VARIANT_BOOL bApplyCurvature,
  VARIANT_BOOL bApplyRefraction,
  Variant* pRefractionFactor
);
[C++]
Parameters
pObserver [in]

pObserver is a parameter of type IPoint* pTarget [in]
pTarget is a parameter of type IPoint* ppObstruction [out]
ppObstruction is a parameter of type IPoint** ppVisibleLines [out]
ppVisibleLines is a parameter of type IPolyline** ppInvisibleLines [out]
ppInvisibleLines is a parameter of type IPolyline** pbIsVisible [out]
pbIsVisible is a parameter of type bool* bApplyCurvature [in]
bApplyCurvature is a parameter of type bool bApplyRefraction [in]
bApplyRefraction is a parameter of type bool pRefractionFactor [in, optional]
pRefractionFactor is a parameter of type VARIANT*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Returns information about the line of sight between two points, an observer and target. Information returned includes whether the target is visible, the location of the first obstruction point if it isn't, and both the visible and invisible portions of the sight line along the surface.

Both the observer and target points need to be 3D. Any vertical offsets that need to be applied should already be accounted for in their Z values.

The obstruction point is set, as a 3D point, if the target is not visible from the observer. In this case the first intersection point, from the observer toward the target, between the surface and line of sight is used. The variable for the obstruction point need not reference an instantiated object. GetLineOfSight will automatically create the point. If the target is visible, there is no obstruction point and the returned object will be a Null pointer ('Nothing' in VB).

The visible and invisible polylines represent that which is seen from the observation point and that which is not. The variables used for these features need not reference instantiated objects. The function will create them. The line of sight may be entirely visible, entirely invisible, or a combination. These polylines will have Z values interpolated from the surface. If there is no output for one or the other of these polylines the corresponding pointer will be Null ('Nothing' in VB).

Set bApplyCurvature to True to have earth curvature taken into consideration. The default is False. It can be set to True if the surface has a defined projected coordinate system that includes defined ZUnits.

Set bApplyRefraction to True to have refraction of visible light taken into consideration. The default is False. It can be set to True if the surface has a defined projected coordinate system that includes defined ZUnits.

The default refraction factor is 0.13.

 

Notes:

This member should not be used in .NET. As a substitute, .NET developers must use IGeoDatabaseBridge2.GetLineOfSight.

See Also

ISurface Interface