ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LineOfSightParams Class / ObserverPoint Property
Example

In This Topic
    ObserverPoint Property
    In This Topic
    Gets and sets the observer point.
    Syntax
    public MapPoint ObserverPoint {get; set;}
    Public Property ObserverPoint As MapPoint
    Remarks
    If specified it will be projected to the spatial reference of the surface.
    Example
    Get Line of Sight
    {
      tinLayer = null;
      MapPoint observerPoint = null;
      MapPoint targetPoint = null;
      CIMPointSymbol obstructionPointSymbol = null;
      CIMLineSymbol visibleLineSymbol = null;
      CIMLineSymbol invisibleLineSymbol = null;
    
      var losParams = new LineOfSightParams();
      losParams.ObserverPoint = observerPoint;
      losParams.TargetPoint = targetPoint;
    
      // add offsets if appropriate
      // losParams.ObserverHeightOffset = observerOffset;
      // losParams.TargetHeightOffset = targerOffset;
    
      // add obstruction feature class if appropriate (multipatch)
      //losParams.ObstructionsMultipatchFeatureClass = obsFeatureClass;
    
      // set output spatial reference
      losParams.OutputSpatialReference = mapView.Map.SpatialReference;
    
      LineOfSightResult results = null;
      try
      {
        await QueuedTask.Run(() =>
        {
          if (tinLayer.CanGetLineOfSight(losParams))
          {
            results = tinLayer.GetLineOfSight(losParams);
          }
        });
      }
      catch (Exception)
      {
        // handle exception
      }
    
      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.AddOverlay(results.VisibleLine, visibleLineSymbol.MakeSymbolReference());
        }
    
        if (results.InvisibleLine != null)
        {
          mapView.AddOverlay(results.VisibleLine, invisibleLineSymbol.MakeSymbolReference());
        }
    
        if (results.ObstructionPoint != null)
        {
          mapView.AddOverlay(results.ObstructionPoint, obstructionPointSymbol.MakeSymbolReference());
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also