Skip to content
GuidesBlogPlaygroundDashboard

Elevation profile along coordinates

client.elevation.profile(ElevationProfileParams { coordinates } body, RequestOptionsoptions?): ElevationProfileResult { geometry, properties, type }
POST/api/v1/elevation/profile

Elevation profile along coordinates

ParametersExpand Collapse
body: ElevationProfileParams { coordinates }
coordinates: Array<Coordinate>

Path coordinates in order of travel (min 2, max 50)

lat: number

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
lng: number

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
ReturnsExpand Collapse
ElevationProfileResult { geometry, properties, type }

GeoJSON LineString Feature with 3D coordinates [lng, lat, elevation] representing the elevation profile along the input path. Summary statistics are in properties.

geometry: GeoJsonGeometry { coordinates, type }

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

coordinates: Array<number> | Array<Array<number>> | Array<Array<Array<number>>> | Array<Array<Array<Array<number>>>>

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
Array<number>
Array<Array<number>>
Array<Array<Array<number>>>
Array<Array<Array<Array<number>>>>
type: "Point" | "LineString" | "Polygon" | 3 more

Geometry type

One of the following:
"Point"
"LineString"
"Polygon"
"MultiPoint"
"MultiLineString"
"MultiPolygon"
properties: Properties { avg_elevation_m, max_elevation_m, min_elevation_m, 2 more }

Elevation profile summary statistics

avg_elevation_m: number

Average elevation along the profile in meters

max_elevation_m: number

Maximum elevation along the profile in meters

min_elevation_m: number

Minimum elevation along the profile in meters

total_ascent_m: number

Total cumulative elevation gain in meters

total_descent_m: number

Total cumulative elevation loss in meters

type: "Feature"

Elevation profile along coordinates

import Plaza from '@plazafyi/sdk';

const client = new Plaza({
  apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted
});

const elevationProfileResult = await client.elevation.profile({
  coordinates: [
    { lat: 48.8566, lng: 2.3522 },
    { lat: 48.858, lng: 2.34 },
    { lat: 48.8584, lng: 2.2945 },
  ],
});

console.log(elevationProfileResult.geometry);
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "avg_elevation_m": 67.8,
    "max_elevation_m": 155.3,
    "min_elevation_m": 28.1,
    "total_ascent_m": 127.4,
    "total_descent_m": 89.2
  },
  "type": "Feature"
}
Returns Examples
{
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "avg_elevation_m": 67.8,
    "max_elevation_m": 155.3,
    "min_elevation_m": 28.1,
    "total_ascent_m": 127.4,
    "total_descent_m": 89.2
  },
  "type": "Feature"
}