Skip to content
GuidesBlogPlaygroundDashboard

Elevation profile along coordinates

ElevationProfileResult Elevation.Profile(ElevationProfileParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/elevation/profile

Elevation profile along coordinates

ParametersExpand Collapse
ElevationProfileParams parameters
required IReadOnlyList<Coordinate> coordinates

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

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
ReturnsExpand Collapse
class ElevationProfileResult:

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

required GeoJsonGeometry Geometry

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

required Coordinates Coordinates

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

One of the following:
IReadOnlyList<Double>
IReadOnlyList<IReadOnlyList<Double>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>>
required Type Type

Geometry type

One of the following:
"Point"Point
"LineString"LineString
"Polygon"Polygon
"MultiPoint"MultiPoint
"MultiLineString"MultiLineString
"MultiPolygon"MultiPolygon
required Properties Properties

Elevation profile summary statistics

required Double AvgElevationM

Average elevation along the profile in meters

required Double MaxElevationM

Maximum elevation along the profile in meters

required Double MinElevationM

Minimum elevation along the profile in meters

required Double TotalAscentM

Total cumulative elevation gain in meters

required Double TotalDescentM

Total cumulative elevation loss in meters

required Type Type

Elevation profile along coordinates

ElevationProfileParams parameters = new()
{
    Coordinates =
    [
        new()
        {
            Lat = 48.8566,
            Lng = 2.3522,
        },
        new()
        {
            Lat = 48.858,
            Lng = 2.34,
        },
        new()
        {
            Lat = 48.8584,
            Lng = 2.2945,
        },
    ],
};

var elevationProfileResult = await client.Elevation.Profile(parameters);

Console.WriteLine(elevationProfileResult);
{
  "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"
}