Skip to content
GuidesBlogPlaygroundDashboard

Elevation profile along coordinates

$client->elevation->profile(list<Coordinate> coordinates): ElevationProfileResult
POST/api/v1/elevation/profile

Elevation profile along coordinates

ParametersExpand Collapse
coordinates: list<Coordinate>

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

ReturnsExpand Collapse

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

Properties properties

Elevation profile summary statistics

Type type

Elevation profile along coordinates

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'My API Key', environment: 'local');

$elevationProfileResult = $client->elevation->profile(
  coordinates: [
    ['lat' => 48.8566, 'lng' => 2.3522],
    ['lat' => 48.858, 'lng' => 2.34],
    ['lat' => 48.8584, 'lng' => 2.2945],
  ],
);

var_dump($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"
}