v1

latestOpenAPI 3.1.02026-08-0420183200.9 KB
Geospatial

Get the elevation profile along a polyline or at a point.

The Stadia elevation API allows you to get the elevation of any point on earth. You can pass either a simple set of points or a Google encoded polyline string. This pairs well with our routing APIs, so you can generate an elevation profile for your next bike or run.

post/elevation/v1

Request body

idstring nullable

An identifier to disambiguate requests (echoed by the server).

shape_format'polyline6' | 'polyline5'

Specifies the precision of an encoded polyline.

rangeboolean

Controls whether the returned array is one-dimensional (height only) or two-dimensional (with a range and height). The range dimension can be used to generate a graph or steepness gradient along a route.

height_precisioninteger

The decimal precision (number of digits after the point) of the output. When 0, integer values are returned. Valid values are 0, 1, and 2.

resample_distanceinteger

The distance in meters at which the input polyline should be sampled to provide uniform distances between points.

Example request

{
  "height_precision": 0,
  "id": "kesklinn",
  "range": false,
  "shape": [
    {
      "lat": 59.436884,
      "lon": 24.742595
    }
  ],
  "shape_format": "polyline6"
}

Response

A list of elevations along the polyline, in meters.

idstring nullable

The request identifier, if provided.

encoded_polylinestring nullable

The input polyline.

heightnumber[] nullable

The list of heights for each point, in meters. Present only if range is false. Null values indicate missing data.

Example response

{
  "id": "kesklinn",
  "shape": [
    {
      "lat": 12.345678,
      "lon": 12.345678
    }
  ]
}