ガイドAPIリファレンス
ガイド

ルートに沿った充電状態を計算する

電気自動車の充電量がルートに沿ってどのように減少するかを表示する、または車両の充電が切れる場所を表示するには、セクションごとの消費量を返すだけでは不十分です。 このために、スパンごとに消費量を返すことができます。これ自体では1つのスパンのみが返されるため、 セグメント参照などの別の属性と組み合わせる必要があります。

curl -gX 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]=10,0.130,20,0.132,30,0.136,40,0.142,50,0.151,60,0.161,70,0.176,80,0.194,90,0.214,100,0.237,110,0.264,120,0.290,130,0.321,140,0.354,150,0.389,160,0.426,170,0.466,180,0.509,190,0.554,200,0.601&'\
'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&'\
'apiKey=YOUR_API_KEY'
"spans": [
  {
    "offset": 0,
    "topologySegmentId": "-here:cm:segment:900613677",
    "consumption": 0.0221
  },
  {
    "offset": 1,
    "topologySegmentId": "-here:cm:segment:900613812",
    "consumption": 0.0368
  },
  {
    "offset": 2,
    "topologySegmentId": "-here:cm:segment:900614474",
    "consumption": 0.0055
  },
  {
    "offset": 3,
    "topologySegmentId": "-here:cm:segment:863515592",
    "consumption": 0.0391
  },
  {...}
]