Skip to content
GuidesBlogPlaygroundDashboard

Elevation profile along coordinates

elevation().profile(ElevationProfileParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : ElevationProfileResult
POST/api/v1/elevation/profile

Elevation profile along coordinates

ParametersExpand Collapse
params: ElevationProfileParams
elevationProfileRequest: ElevationProfileRequest

Request body for elevation profile along a path. Provide at least 2 coordinates defining the path. Maximum 50 coordinates per request.

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.

geometry: GeoJsonGeometry

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

coordinates: Coordinates

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

One of the following:
List<Double>
List<List<Double>>
List<List<List<Double>>>
List<List<List<List<Double>>>>
type: Type

Geometry type

One of the following:
POINT("Point")
LINE_STRING("LineString")
POLYGON("Polygon")
MULTI_POINT("MultiPoint")
MULTI_LINE_STRING("MultiLineString")
MULTI_POLYGON("MultiPolygon")
properties: Properties

Elevation profile summary statistics

avgElevationM: Double

Average elevation along the profile in meters

maxElevationM: Double

Maximum elevation along the profile in meters

minElevationM: Double

Minimum elevation along the profile in meters

totalAscentM: Double

Total cumulative elevation gain in meters

totalDescentM: Double

Total cumulative elevation loss in meters

type: Type

Elevation profile along coordinates

package com.plazafyi.example

import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.elevation.ElevationProfileParams
import com.plazafyi.models.elevation.ElevationProfileRequest
import com.plazafyi.models.elevation.ElevationProfileResult

fun main() {
    val client: PlazaClient = PlazaOkHttpClient.fromEnv()

    val params: ElevationProfileRequest = ElevationProfileRequest.builder()
        .coordinates(listOf(
          ElevationProfileRequest.Coordinate.builder()
              .lat(48.8566)
              .lng(2.3522)
              .build(),
          ElevationProfileRequest.Coordinate.builder()
              .lat(48.858)
              .lng(2.34)
              .build(),
          ElevationProfileRequest.Coordinate.builder()
              .lat(48.8584)
              .lng(2.2945)
              .build(),
        ))
        .build()
    val elevationProfileResult: ElevationProfileResult = client.elevation().profile(params)
}
{
  "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"
}