How to build an app to find elevation

1. Select an operation

The first step is to determine which request to use from the elevation service. The service supports two requests: /at-point to find the elevation of a single point or /at-many-points to find the elevation of multiple points.

Use dark colors for code blocksCopy
1
GET https://elevation-api.arcgis.com/arcgis/rest/services/elevation-service/v1/elevation/at-point

2. Define input parameters

The next step is to provide input parameters for the operation. For the multiple points operation, you are required to provide a request body. Both single point and multiple points operations require latitude and longitude coordinates of the location(s) of interest. You can also specify the datum for the elevation values, such as above mean sea level or ground level. The most common parameters are listed in the table below.

The following parameters are used to get an elevation value of a single coordinate:

NameDescriptionExamples
lonThe longitude of the specified point.lon=-157.7079
latThe latitude of the specified point.lat=21.4040
relativeToThe datum from which to measure elevation. The supported datums are above mean sea level or above ground level.relativeTo=meanSeaLevel (default value), relativeTo=ellipsoid

3. Make a request

The final step is to make a request to the elevation service using an ArcGIS Maps SDK, scripting API, or open source library. In general, you:

  1. Reference the service endpoint.
  2. Set the coordinates.
  3. Set your access token.

APIs

ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptEsri LeafletMapLibre GL JSOpenLayersCesiumJSREST JS
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
        async function getElevationData(lon, lat) {
          const url =
            "https://elevation-api.arcgis.com/arcgis/rest/services/elevation-service/v1/elevation/at-point";

          const response = await esriRequest(url, {
            query: {
              lon: lon,
              lat: lat,
            },
            responseType: "json",
          });

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

          arcgisMap.popup = {
            visibleElements: {
              collapseButton: false,
              closeButton: false,
              actionBar: false,
            },
          };

          const title = `Elevation relative to mean sea level`;
          const content = `
            Latitude: ${y.toFixed(5)}<br>
            Longitude: ${x.toFixed(5)}<br>
            Elevation: ${z} m`;

          addPointToMap(lon, lat);

          arcgisMap.openPopup({
            location: [lon, lat],
            content: content,
            title: title,
          });
        }
Expand

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
# You can also use wget
curl -X GET https://elevation-api.arcgis.com/arcgis/rest/services/elevation-service/v1/elevation/at-point?lon=-179.99&lat=-85.05 \
  -d "f=json" \
  -d "token=<YOUR_ACCESS_TOKEN>"

Additional resources

Tutorials

Find the elevation of a point

Find elevation value of a single location on land or water.


Find the elevations of multiple points

Find elevation values of multiple locations on land or water.


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