Introduction to elevation

To find the elevation of a location, you use the ArcGIS Elevation service. The Elevation service is a location service that returns elevation values for a single location or multiple locations. Elevation coverage is provided for both topography (land elevations) and bathymetry (water depths) and takes location inputs as longitude and latitude coordinates. All elevation values will be returned in meters as measures of ellipsoidal height above ground level or orthometric height above mean sea level.

You can build applications that use the service to:

  • Determine the height of a specific location above mean sea level or ground level.
  • Measure the depth of a water body at a specific location.
  • Compare the relative elevation of different points to determine slope.
  • Plan flight paths by assessing elevation changes along a route.
  • Create elevation profiles of trails or roads.

How to access the Elevation service

There is no direct integration with OpenLayers to access the Elevation service. Instead, you use the ArcGIS REST JS elevation and request packages to make an authenticated request to the service.

  1. Reference the OpenLayers library.
  2. Reference the elevation and request packages to make an authenticated request to the service.
  3. Set up authentication.
    • If you are using an API key, make sure it has privileges to access the Elevation service.
    • If you are using user authentication, the account must be an ArcGIS Location Platform account with Elevation service privileges.
  4. Define parameters to pass to the service.
  5. Call the service and handle the results.

Example

Find the elevation of a point

This example illustrates how to find the elevation of a specific location.

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
    olms.apply(map, basemapURL).then(() => {

      const popup = new Popup();
      map.addOverlay(popup);

      const markerLayer = new ol.layer.Vector({
        source: new ol.source.Vector()
      });
      map.addLayer(markerLayer);

      const circle = new ol.style.Style({
        image: new ol.style.Circle({
          radius: 4,
          fill: new ol.style.Fill({ color: "#FF0000" }),
          stroke: new ol.style.Stroke({ color: "#000", width: 1 })
        })
      });


      map.on("click", async (event) => {

        const coordinate = ol.proj.toLonLat(event.coordinate);
        const [lng, lat] = coordinate;
        const response = await arcgisRest.findElevationAtPoint({
          lon: lng,
          lat: lat,
          relativeTo: elevationMeasure,
          authentication: arcgisRest.ApiKeyManager.fromKey(accessToken)
        })

        const { x, y, z } = response.result.point;

        let message = `<b>Elevation relative to ${elevationMeasure === "meanSeaLevel" ? "mean sea level" : "ground level"}</b><br>Latitude: ${y.toFixed(5)}<br>Longitude: ${x.toFixed(5)}<br>Elevation: ${z} m`;

        popup.show(event.coordinate, message);

        const point = new ol.Feature({
          geometry: new ol.geom.Point(event.coordinate)
        });
        point.setStyle(circle);
        markerLayer.getSource().clear();
        markerLayer.getSource().addFeature(point);

      });
Expand

Find the elevations of multiple points

This example illustrates how to get elevation values of multiple locations at once.

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
    async function displayElevationData() {

      const data = await arcgisRest.findElevationAtManyPoints({
        coordinates: points,
        authentication: arcgisRest.ApiKeyManager.fromKey(accessToken)
      });

      const elevationValues = data.result.points.map((point) => point.z);

      // Points
      points.forEach(([lon, lat], index) => {
        const elevation = elevationValues[index];
        // Popup
        const popup = new Popup();
        popup.container.getElementsByClassName('ol-popup-closer')[0].remove();
        popup.container.style = 'width:30px;'
        map.addOverlay(popup);

        popup.show(ol.proj.fromLonLat([lon, lat]),`${elevation} m`);

      });

    }
Expand

Tutorials

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