3D line of sight

Visual lines of sight from an observer point to target locations in Yosemite valley.

What is line of sight analysis?

3D line of sight analysis is a type of visibility analysis that calculates whether a target location is visible from an observer location and renders a line indicating visibility to the scene view. You can perform it in real-time to dynamically update whenever an observer or target moves.

Line of sight analysis has practical applications in architecture, military science, and many other fields.

Real-world use cases for line of sight analysis include the following:

  • Designing civic structures such as roads and theatres.
  • Minimizing the visibility of oil rigs and junkyards in urban areas.
  • Preserving key views of famous landmarks and parks in city skylines.

Types of line of sight operations

The following table describes the different types of 3D line of sight operations:

OperationDescriptionExample
LocationLineOfSight(observer, target), LineOfSightAnalysisPerforms a line of sight analysis between two point locations in a scene. lineofsight location square
GeoElementLineOfSight(observer, target)Performs a line of sight analysis between two geoelements in a scene. lineofsight geoelement square

How to perform a line of sight analysis

The general steps to perform a line of sight analysis are as follows:

  1. Create a scene view and set its extent to the desired location.

  2. Create a point or geoelement to serve as an observer, then create a second to serve as a target.

  3. Create a LineOfSight analysis that matches the type of your observer and target.

  4. Add the LineOfSight analysis to the scene view to display the results.

Code examples

Display a line of sight (Point)

This example performs and displays a line of sight analysis in a scene view at the provided observer and target locations (3D points). Line of sight analysis can be performed by either using the analysis operation directly or using the JavaScript LineOfSight widget.

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
      viewModel.observer = new Point({
        latitude: 37.7462,
        longitude: -119.5743,
        z: 1300
      });

      viewModel.targets = [
        createTarget(37.7339, -119.6377, 2300), // El capitan
        createTarget(37.7459, -119.5332, 2700), // Half dome
        createTarget(37.7130, -119.6046, 2300), // Taft point
        createTarget(37.7566, -119.5969, 2250), // Yosemite falls
        createTarget(37.7569, -119.5599, 2300), // North dome
        createTarget(37.7677, -119.4894, 2800), // Clouds rest
        createTarget(37.7230, -119.5843, 2450), // Sentinel Dome
        createTarget(37.7248, -119.5333, 1800) // Nevada falls
      ];

      function createTarget(lat, lon, z) {
        return {
          location: new Point({
            latitude: lat,
            longitude: lon,
            z: z || 0
          })
        };
      }

Display a line of sight (GeoElement)

This example performs and displays a line of sight analysis in a scene view at the provided observer (taxi) and target (building) geoelements, updating the analysis dynamically whenever the geoelement taxi changes position.

lineofsight-geoelement
ArcGIS Maps SDK for .NETArcGIS Maps SDK for .NETArcGIS Maps SDK for KotlinArcGIS Maps SDK for SwiftArcGIS Maps SDK for JavaArcGIS Maps SDK for Qt
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
private void CreateLineOfSight(GeoElement observer, GeoElement target)
{
    _geoLine = new GeoElementLineOfSight(_observerGraphic, _taxiGraphic)
    _analysisOverlay.Analyses.Add(_geoLine);
    SceneView.AnalysisOverlays.Add(_analysisOverlay);
}

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