Powered by Zoomin Software. For more details please contactZoomin

HERE Routing API v8 - Developer Guide

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Routing API v8 - Developer Guide: Calculate elevation profile

Table of Contents
HomeHERE Routing API v8 - Developer GuideCalculate elevation profileCurrent page
Table of Contents

Calculate elevation profile

To obtain the elevation of a route, specify return=elevation in addition to return=polyline in your route request.

This will result in a 3D polyline field in each section. This polyline is encoded using a flexible polyline.

You can decode this polyline using:

The decoded polyline will consist of a series of 3D coordinates (latitude, longitude, elevation), with elevation represented as meters above sea-level in the WGS84 coordinate system.

curl -gX GET 'https://router.hereapi.com/v8/routes?'\
'transportMode=car&'\
'origin=52.5308,13.3847&'\
'destination=52.5323,13.3789&'\
'return=polyline,elevation&'\
'apiKey={YOUR_API_KEY}'
{
  "routes": [
    {
      "id": "81e526c0-5693-4bc0-bdbb-239ecc2857e7",
      "sections": [
        {
          ...,
          "polyline": "B2FwynmkDu39wZouBvBtFA3InfAvHrdAvHvbAoGzFA0FnGAoGvHUsOvRA8L3NAkSvWAoGvHAsEzFAgFvHAkD3IAwHrJAwHrJAgKjNA4D_EA0ezoBAjInVA3N_iBAzJ_ZA",
          "transport": {
            "mode": "car"
          },
          "type": "vehicle"
        }
      ]
    }
  ]
}

The polyline decodes to:

echo BGwynmkDu39wZvBtF3InfvHrdvHvboGzF0FnGoGvHsOvR8L3NkSvWoGvHsEzFgFvHkD3IwHrJwHrJgKjN4D_E0ezoBjInV3N_iBzJ_Z | flexpolyline decode --original-precision
{(6, 1, 3);
 [(52.530984, 13.384567, 74.0),
  (52.530960, 13.384480, 74.0),
  (52.530820, 13.383980, 74.0),
  (52.530700, 13.383510, 74.0),
  (52.530580, 13.383070, 74.0),
  (52.530680, 13.382980, 74.0),
  (52.530770, 13.382880, 74.0),
  (52.530870, 13.382760, 75.0),
  (52.531100, 13.382480, 75.0),
  (52.531290, 13.382260, 75.0),
  (52.531580, 13.381900, 75.0),
  (52.531680, 13.381780, 75.0),
  (52.531750, 13.381690, 75.0),
  (52.531830, 13.381570, 75.0),
  (52.531880, 13.381430, 75.0),
  (52.532000, 13.381280, 75.0),
  (52.532120, 13.381130, 75.0),
  (52.532280, 13.380920, 75.0),
  (52.532340, 13.380840, 75.0),
  (52.532830, 13.380190, 75.0),
  (52.532700, 13.379850, 75.0),
  (52.532480, 13.379290, 75.0),
  (52.532326, 13.378874, 75.0), ]}

Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert