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

The Esri Leaflet plugin does not provide direct integration for accessing 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 Esri Leaflet plugin.
  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 get elevation data 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
    let circleMarker = null;

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

      const { lat, lng } = e.latlng;

      if (circleMarker) {
        map.removeLayer(circleMarker);
      }

      circleMarker = L.circle([lat, lng], {
        color: "#00000",
        fillColor: "#FF0000",
        radius: 75,
        fillOpacity: 1
      }).addTo(map);

      const response = await arcgisRest.findElevationAtPoint({
        lon: lng,
        lat: lat,
        relativeTo: elevationMeasure,
        authentication: arcgisRest.ApiKeyManager.fromKey(accessToken)
      });

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

      L.popup()
        .setLatLng(e.latlng)
        .setContent(
          `<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`
        )
        .openOn(map);

    });
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
    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.forEach(([lng, lat], index) => {
        L.marker([lat, lng])
          .addTo(map)
          .bindTooltip(`${elevationValues[index]} m`, { permanent: true, direction: "top", offset: [-15, -10] })
          .openTooltip();
      });

    }

    displayElevationData();
Expand

Tutorials

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