Multiple point elevations

Get elevation values for a ferry route from Wellington, New Zealand to Somes Island

Point elevation is the vertical distance (height) of a single location on the Earth's surface based on a datum such as mean sea level or ground level. To find multiple point elevations, you use the /elevation/at-many-points request for the ArcGIS Elevation service. It is a batch operation that finds the elevations of many points at one time and can be used to perform tasks such as measuring the heights of geographic features, generating elevation profiles, determining terrain variations of a region.

You can use this operation to:

  • Find the elevations of multiple geographic features such as weather stations.
  • Create elevation profiles of trails or roads.
  • Analyze terrain patterns across a region.
  • Measure depth variations in water bodies.
  • Plan flight paths by assessing elevation changes along a route.

How to find the elevations of multiple points

The typical workflow to find the elevations of multiple points is to:

  1. Define an array of longitude, latitude pairs (up to 100).
  2. Define the datum, e.g. mean sea level or ellipsoid (ground level).
  3. Access the Elevation service using an access token with Elevation service privileges.

URL request

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

Required parameters

NameDescriptionExamples
coordinatesAn array of (longitude, latitude) pairs in the WGS84 spatial reference with a maximum size of 100 coordinates.[[31.134167, 29.979167], [31.130833, 29.976111], [31.128333, 29.9725]]
tokenAn API key or OAuth 2.0 access token.token=<YOUR_ACCESS_TOKEN>

Key parameters

NameDescriptionExamples
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
fThe format of the data returned.f=json, f=pjson

Code examples

This example uses /elevation/at-many-points to get the elevation values for an array of coordinates. Each coordinate is a pair of longitude and latitude. The datum used in this example is meanSeaLevel to show elevation above mean sea level.

Steps

  1. Reference the elevation service.
  2. Define an array of coordinates to retrieve elevation values for.
  3. Optionally, include the relativeTo parameter with a value of either meanSeaLevel or ellipsoid.
  4. Set the token parameter to your access token.

Find the elevations of multiple points

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
155
156
157
158
      async function getElevationData() {
        const url = "https://elevation-api.arcgis.com/arcgis/rest/services/elevation-service/v1/elevation/at-many-points";

        const data = await arcgisRest.request(url, {
          method: "POST",
          params: {
            coordinates: JSON.stringify(points),
          },
          authentication: arcgisRest.ApiKeyManager.fromKey(esriConfig.apiKey),
        });

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

        points.forEach(([longitude, latitude], index) => {
          const elevation = elevationValues[index];

          const point = {
            type: "point",
            longitude: longitude,
            latitude: latitude,
          };

          const simpleMarkerSymbol = {
            type: "simple-marker",
            color: "black",
            size: "10px",
            outline: {
              color: "white",
              width: 1,
            },
          };

          const popupTemplate = {
            title: "Elevation data relative to mean sea level",
            content: `Latitude: ${latitude}<br>Longitude: ${longitude}<br>Elevation: ${elevation} meters`,
          };

          const polylineGraphic = new Graphic({
            geometry: {
              type: "polyline",
              paths: points
            },
            symbol: {
              type: "simple-line",
              width: 1,
            },
          });

          graphicsLayer.add(polylineGraphic);

          const pointGraphic = new Graphic({
            geometry: point,
            symbol: simpleMarkerSymbol,
            popupTemplate: popupTemplate,
          });

          graphicsLayer.add(pointGraphic);
        });
Expand

REST API

cURLcURLHTTP
Use dark colors for code blocksCopy
1
2
3
4
5
# You can also use wget
curl -X POST https://elevation-api.arcgis.com/arcgis/rest/services/elevation-service/v1/elevation/at-many-points \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_ACCESS_TOKEN'

Tutorials

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.