Skip to content

Elevation is the height of a location above or below a reference point, such as mean sea level or ground level.

You can use the arcgis-rest-elevation package to access the ArcGIS Elevation service.

Steps
  1. Install and reference the arcgis-rest-elevation and arcgis-rest-request packages.
  2. Set an access token to authenticate the request.
  3. Define parameters to pass to the service.
  4. Call the service and handle the results.

Point elevation

You can find the elevation of a single location, such as a mountaintop, landmark, or your current position. This is useful for checking height above sea level, measuring water depth, or comparing elevation between locations.

Find the elevation of a point

Learn how to find the elevation of a point with the findElevationAtPoint method.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { findElevationAtPoint } from "@esri/arcgis-rest-elevation";

const accessToken = "YOUR_ACCESS_TOKEN";
const authentication = ApiKeyManager.fromKey(accessToken);

findElevationAtPoint({
  lon: -11.7,
  lat: 12.3,
  relativeTo: "ellipsoid",
  authentication
}).then((response) => {
  console.log(JSON.stringify(response, null, 2));
});
Go to tutorial

Multiple point elevations

You can measure the elevation at many locations such as along a hiking trail. This is useful for making one request to get elevations to create profiles or to plan routes based on elevation values.

Find the elevation of multiple points

Learn how to find the elevation of multiple points with the findElevationAtManyPoints method.

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

import { ApiKeyManager } from "@esri/arcgis-rest-request";
import { findElevationAtManyPoints } from "@esri/arcgis-rest-elevation";

const accessToken = "YOUR_ACCESS_TOKEN";
const authentication = ApiKeyManager.fromKey(accessToken);

findElevationAtManyPoints({
  coordinates: [
    [1.2783, 51.1102], // Dover, UK
    [1.3507, 51.0883],
    [1.4206, 51.0524],
    [1.4939, 51.0162],
    [1.5978, 50.9827],
    [1.7302, 50.9387] // Calais, France
  ],
  authentication
}).then((response) => {
  console.log(JSON.stringify(response, null, 2));
});
Go to tutorial

More resources

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