3D measurement

Measure distance and area interactively in 3D.

What is a 3D measurement analysis?

A 3D measurement is a type of operation that calculates and displays measurements of elements in a 3D scene. 3D measurement operations can measure the direct, vertical, and horizontal distance between points, as well as the area and perimeter of polygons.

Real-world use cases for 3D measurement analysis include the following:

  • Measuring the actual size of countries and states, which are often distorted by map projections.
  • Measuring the topographic prominence of hills and mountain ranges.
  • Visualizing the distance between map features to gain a deeper understanding of spatial relationships.
  • Determining the size and shape of real estate plots.
  • Designing urban structures.

Types of 3D measurement operations

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

OperationDescriptionExample
LocationDistanceMeasurement, DirectLineMeasurementAnalysisMeasures direct, vertical, and horizontal distance between two point locations in a scene. directline measurement square
AreaMeasurementAnalysisMeasures the area and perimeter of a 2D polygon. Only available in ArcGIS Maps SDK for JavaScript. area measurement square

Distance measurement

A distance measurement analysis is a type of measurement analysis that calculates and displays the distance between a 3D start and end point. The analysis evaluates the vertical, horizontal, and direct distances between the two points and renders a measurement visualization in the scene view.

If the length of the distance line exceeds 100km, the measurement method will be geodesic to account for the Earth's curvature. Otherwise, the analysis will be a planar measurement.

Area measurement

An area measurement analysis is a type of measurement analysis that calculates the area of a polygon in a scene. The analysis evaluates the surface area and perimeter of a polygon and renders a measurement visualization in the scene view. The measurement polygon can have points at differing heights (z values), but must be two-dimensional.

If a side of the shape's perimeter exceeds 100km, the measurement method will be geodesic to account for the Earth's curvature. Otherwise, the analysis will be a planar measurement.

How to perform a 3D measurement

The following are the basic steps to performing 3D distance and area measurement with ArcGIS APIs.

Distance measurement

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

  2. Identify the segment you want to measure and create two points to mark its beginning and end.

  3. Create a LocationDistanceMeasurement and set its start and end to the points you created.

  4. Add the LocationDistanceMeasurement to a new AnalysisOverlay.

  5. Add the AnalysisOverlay to the scene view to display the results.

Area measurement

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

  2. Create a new AreaMeasurementAnalysis operation, either directly or through the AreaMeasurement3D widget.

  3. Supply an area for the operation to measure, either by providing an existing polygon or by sketching a new one through the AreaMeasurement3D widget.

  4. Add the operation to the scene view to view the measurement results.

Code examples

Distance measurement

This example calculates and displays measurements of buildings in New York City. You can create 3D Distance measurements either by directly using the analysis operation or by using the JavaScript DirectLineMeasurement3D 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
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
              activeWidget = new DirectLineMeasurement3D({
                view: view
              });

Area measurement

This example calculates and displays the area of different real estate parcels when they are clicked. It calculates area using the AreaMeasurementAnalysis operation, rather than the AreaMeasurement3D widget.

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
        // create a AreaMeasurement object and add it to the `view.analyses`
        const areaMeasurementAnalysis = new AreaMeasurementAnalysis();
        view.analyses.add(areaMeasurementAnalysis);

        view.when(() => {
          const hitTestLayers = view.map.layers.filter((layer) => layer.title === "Parcels");
          view.on("click", async (event) => {
            // remove the current measured geometry from the layer when the user clicks on the map
            areaMeasurementAnalysis.geometry = null;
            // get results from the "Parcels" layer
            const hitTestResult = await view.hitTest(event, { include: hitTestLayers });
            if (hitTestResult.results.length > 0) {
              const geometry = hitTestResult.results[0].graphic.geometry;

              // pass the polygon geometry to the areaMeasurementAnalysis to display a new measurement
              areaMeasurementAnalysis.geometry = geometry;

            }
          });
        });

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