Calculating energy consumption

To obtain energy consumption of the electric vehicle, add details of consumption model to the request. All request parameters related to EV vehicles start with prefix ev. Details on the consumption model are described in section Consumption model.

Energy consumption per section

Energy consumption will be returned for every section in its summary. Resulting energy consumption is in kWh.

curl -X GET \
  'https://router.hereapi.com/v8/routes?origin=52.533864,13.357444&transportMode=car&destination=52.512139,13.438468&return=summary&ev[freeFlowSpeedTable]=0,0.239,27,0.239,45,0.259,60,0.196,75,0.207,90,0.238,100,0.26,110,0.296,120,0.337,130,0.351,250,0.351&ev[trafficSpeedTable]=0,0.349,27,0.319,45,0.329,60,0.266,75,0.287,90,0.318,100,0.33,110,0.335,120,0.35,130,0.36,250,0.36&ev[auxiliaryConsumption]=1.8&ev[ascent]=9&ev[descent]=4.3'
{
  "routes": [
    {
      "id": "441cb1bb-02c0-4d56-a579-f199506fc781",
      "sections": [
        {
          "id": "fb5d1478-8794-4150-8f01-e5126fbe5c8a",
          "type": "vehicle",
          "departure": {
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5343033,
                "lng": 13.3588567,
                "elv": 81
              },
              "originalLocation": {
                "lat": 52.533864,
                "lng": 13.357444
              }
            }
          },
          "arrival": {
            "place": {
              "type": "place",
              "location": {
                "lat": 52.5121573,
                "lng": 13.4384088,
                "elv": 76
              },
              "originalLocation": {
                "lat": 52.512139,
                "lng": 13.438468
              }
            }
          },
          "summary": {
            "duration": 1314,
            "length": 7431,
            "consumption": 3.9096,
            "baseDuration": 1026
          },
          "transport": {
            "mode": "car"
          }
        }
      ]
    }
  ]
}

Displaying state of charge on route

Some users would like to display how the charge of the electric vehicle is decreasing along the route, or where the vehicle would run out of charge. For this it is not enough to return consumption per section. For this purpose it is possible to return consumption per span. By itself, this would return only one span, so it needs to be coupled with another attribute, for example, segment ids.

curl -X GET \
  https://router.hereapi.com/v8/routes?origin=52.533864,13.357444&spans=consumption,segmentId&transportMode=car&destination=52.512139,13.438468&return=summary,polyline&ev[freeFlowSpeedTable]=0,0.239,27,0.239,45,0.259,60,0.196,75,0.207,90,0.238,100,0.26,110,0.296,120,0.337,130,0.351,250,0.351&ev[trafficSpeedTable]=0,0.349,27,0.319,45,0.329,60,0.266,75,0.287,90,0.318,100,0.33,110,0.335,120,0.35,130,0.36,250,0.36&ev[auxiliaryConsumption]=1.8&ev[ascent]=9&ev[descent]=4.3
...
"spans": [
  {
    "offset": 0,
    "topologySegmentId": "+here:cm:segment:192033902",
    "consumption": 0.0552
  },
  {
    "offset": 3,
    "topologySegmentId": "-here:cm:segment:658795688",
    "consumption": 0.01
  },
...

results matching ""

    No results matching ""