Line of sight (location)

View inAndroidFormsUWPWPFWinUIiOSView on GitHub

Perform a line of sight analysis between two points in real time.

Image of line of sight location

Use case

A line of sight analysis can be used to assess whether a view is obstructed between an observer and a target. Obstructing features could either be natural, like topography, or man-made, like buildings. Consider an events planning company wanting to commemorate a national event by lighting sequential beacons across hill summits or roof tops. To guarantee a successful event, ensuring an unobstructed line of sight between neighboring beacons would allow each beacon to be activated as intended.

How to use the sample

Tap to place the starting point for the line. Tap again to place the end point.

How it works

  1. Create an AnalysisOverlay and add it to the scene view.
  2. Create a LocationLineOfSight with initial observer and target locations and add it to the analysis overlay.
  3. Listen for taps on the scene view.
  4. Update the target location with lineOfSight.TargetLocation = scenePoint.

Relevant API

  • AnalysisOverlay
  • LocationLineOfSight
  • SceneView

Tags

3D, line of sight, visibility, visibility analysis

Sample Code

LineOfSightLocation.xamlLineOfSightLocation.xamlLineOfSightLocation.xaml.cs
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ArcGISRuntime.Samples.LineOfSightLocation.LineOfSightLocation"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Xamarin.Forms;assembly=Esri.ArcGISRuntime.Xamarin.Forms">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
    </Grid>
</ContentPage>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.