Skip to content
GuidesBlogPlaygroundDashboard

Elevation profile along coordinates

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

Elevation profile along coordinates

ParametersExpand Collapse
ElevationProfileParams params
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.

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

double avgElevationM

Average elevation along the profile in meters

double maxElevationM

Maximum elevation along the profile in meters

double minElevationM

Minimum elevation along the profile in meters

double totalAscentM

Total cumulative elevation gain in meters

double totalDescentM

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;
import java.util.List;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        PlazaClient client = PlazaOkHttpClient.fromEnv();

        ElevationProfileRequest params = ElevationProfileRequest.builder()
            .coordinates(List.of(
              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();
        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"
}