Line of sight (location)

View inMAUIUWPWPFWinUIView 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
10
11
12
13
<UserControl
    x:Class="ArcGIS.UWP.Samples.LineOfSightLocation.LineOfSightLocation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:esriUI="using:Esri.ArcGISRuntime.UI.Controls">
    <Grid>
        <esriUI:SceneView x:Name="MySceneView" />
        <Border Style="{StaticResource BorderStyle}">
            <TextBlock Text="Tap to set a start point. Tap again to set an end point."
                       TextWrapping="Wrap" FontWeight="SemiBold" />
        </Border>
    </Grid>
</UserControl>

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