Perform a line of sight analysis between two points in real time.
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
- Create an
AnalysisOverlay
and add it to the scene view. - Create a
LocationLineOfSight
with initial observer and target locations and add it to the analysis overlay. - Listen for taps on the scene view.
- Update the target location with
lineOfSight.TargetLocation = scenePoint
.
Relevant API
- AnalysisOverlay
- LocationLineOfSight
- SceneView
Tags
3D, line of sight, visibility, visibility analysis
Sample Code
<UserControl
x:Class="ArcGISRuntime.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>