Point elevation

Find elevation of land and water near Anchorage, Alaska

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 the elevation of a point, you use the /elevation/at-point request for the Elevation service. It is often used to build applications that allow users to interactively inspect elevation values of terrain and water bodies on a map.

You can use point elevation to:

  • Get the elevation value of your geolocation.
  • Determine the height of a specific location above mean sea level or ground level.
  • Find the elevation of terrain and geographic features such as a mountaintop, tower, or landmark.
  • Compare the relative elevation of different points to determine slope.
  • Measure the depth of a water body at a specific location.

How to find the elevation of a point

The typical workflow to find the elevation of a point is to:

  1. Define the latitude and longitude of a location.
  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-point

Required parameters

NameDescriptionExamples
lonThe longitude of the specified point.lon=-157.7079
latThe latitude of the specified point.lat=21.4040
tokenAn API key or OAuth 2.0 access token.token=<YOUR_ACCESS_TOKEN>

Key parameters

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

Code examples

Find the elevation of a point

This example uses the /elevation/at-point request to get the elevation value of a point when you click on the map. The point contains a longitude and latitude that is passed to the service. The datum used in this example is meanSeaLevel to show elevation above mean sea level.

Steps

  1. Reference the Elevation service.
  2. Set the lon and lat parameters to the longitude and latitude of the clicked point on the map.
  3. Optionally, include the relativeTo parameter with a value of either meanSeaLevel or ellipsoid.
  4. Set the token parameter to 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>"

Tutorials

Find the elevation of a point

Find elevation value of a single location 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.