# Calculate a route with charging - reserve

There are situations where adding a reserve charge at the destination is required. The reasons may include the following:

• The consumption model does not compute energy consumption precisely and user wants to ensure the destination can be reached.
• It is not possible to charge at the destination. The reserve is needed for the next journey.

There are three optional parameters that can be used for this purpose, both with value 0 by default:

• ev[minChargeAtDestination] is used only for the destination waypoint.
• ev[minChargeAtFirstChargingStation] is used for first charging station waypoint.
• ev[minChargeAtChargingStation] is used for all charging station waypoints, except for the first one, if ev[minChargeAtFirstChargingStation] is specified.

Waypoints that are neither charging stops nor the destination do not support the corresponding parameter, as there is no use-case for them to have a reserve.

The following example describes a scenario specifying 10% of the maximum charge (8kWh) as minimum charge at a charging station. Additionally, it specifies 50kWh as minimum required charge at the destination. Because of this, there is now an additional charging station close to the destination. The response has three sections.

curl -X GET \
https://router.hereapi.com/v8/routes?departureTime=any&origin=52.533959,13.404780&ev[connectorTypes]=iec62196Type2Combo&transportMode=car&destination=51.741505,14.352413&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&ev[makeReachable]=true&ev[initialCharge]=48&ev[maxCharge]=80&ev[chargingCurve]=0,239,32,199,56,167,60,130,64,111,68,83,72,55,76,33,78,17,80,1&ev[maxChargeAfterChargingStation]=72&ev[minChargeAtChargingStation]=8&ev[minChargeAtDestination]=50&apikey={YOUR_API_KEY}

{
"routes": [
{
"id": "c8dffbf5-d80d-47b1-a881-75a13365ee47",
"sections": [
{
"id": "27ae0759-0b76-4445-ace6-3eac17dc26bd",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 829,
"consumablePower": 100,
"arrivalCharge": 40.9789,
"targetCharge": 64
}
],
"departure": {
"place": {
"type": "place",
"location": {
"lat": 52.5338756,
"lng": 13.4050139,
"elv": 91
},
"originalLocation": {
"lat": 52.5339589,
"lng": 13.4047799
}
},
"charge": 48
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.4278437,
"lng": 13.5197486,
"elv": 75
},
"id": "5103"
},
"charge": 40.9789
},
"summary": {
"duration": 2603,
"length": 17982,
"consumption": -16,
"baseDuration": 2603
},
"transport": {
"mode": "car"
}
},
{
"id": "a3983cff-9402-4522-a74f-f5848005faa0",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 2001,
"consumablePower": 62,
"arrivalCharge": 21.5392,
"targetCharge": 56
}
],
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.4278437,
"lng": 13.5197486,
"elv": 75
},
"id": "5103"
},
"charge": 64
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 51.7486348,
"lng": 14.3282201,
"elv": 116
},
"id": "5126"
},
"charge": 21.5392
},
"summary": {
"duration": 6043,
"length": 111088,
"consumption": 8,
"baseDuration": 6043
},
"transport": {
"mode": "car"
}
},
{
"id": "f0c912dd-a0e5-40f4-b060-27ef09df2976",
"type": "vehicle",
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 51.7486348,
"lng": 14.3282201,
"elv": 116
},
"id": "5126"
},
"charge": 56
},
"arrival": {
"place": {
"type": "place",
"location": {
"lat": 51.7412356,
"lng": 14.3525337,
"elv": 115
},
"originalLocation": {
"lat": 51.741505,
"lng": 14.3524129
}
},
"charge": 54.142
},
"summary": {
"duration": 525,
"length": 4135,
"consumption": 1.858,
"baseDuration": 525
},
"transport": {
"mode": "car"
}
}
]
}
]
}


If the initial charge is too low, no charging station might be reachable with the ev[minChargeAtChargingStation] limitation. One option would be to reduce this number, but this would have one undesired effect, as all charging station will be reached with low charge. Instead of this, ev[minChargeAtFirstChargingStation] can be specified. This will allow vehicle to reach the nearest charging station, but it will not affect the rest of the route.

The following example describes a scenario where initial charge is low (10kWh) and no station is reachable with ev[minChargeAtChargingStation] set to 8kWh. ev[minChargeAtFirstChargingStation] is set to 2kWh to solve the issue.

curl -X GET \
https://router.hereapi.com/v8/routes?&origin=52.853812,13.010695&destination=51.741505,14.352413&return=summary,polyline&transportMode=car&departureTime=any&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&ev[initialCharge]=10&ev[maxCharge]=80&ev[chargingCurve]=0,239,32,199,56,167,60,130,64,111,68,83,72,55,76,33,78,17,80,1&ev[maxChargeAfterChargingStation]=72&ev[minChargeAtChargingStation]=8&ev[makeReachable]=true&ev[connectorTypes]=iec62196Type2Combo&ev[minChargeAtFirstChargingStation]=2&apikey={YOUR_API_KEY}

{
"routes": [
{
"id": "f0ebfd19-5300-4339-a8e0-89b8ea0a6dbd",
"sections": [
{
"id": "4d811ce1-ea6a-465c-8886-5735c069a1bd",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 1295,
"consumablePower": 50,
"arrivalCharge": 6.0088,
"targetCharge": 24
}
],
"departure": {
"place": {
"type": "place",
"location": {
"lat": 52.8538095,
"lng": 13.0113435,
"elv": 86
},
"originalLocation": {
"lat": 52.8538119,
"lng": 13.010695
}
},
"charge": 10
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.7649995,
"lng": 13.0261866,
"elv": 77
},
"id": "ZW06ZGQ3Mzk3MDVkMGYxZDFmZjQwNjUwOGE4NTU5YjY4Mjk",
"name": "Lidl Filiale Kremmen",
"attributes": {
"power": 50,
"current": 100,
"voltage": 500,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "62122cc124eb680ea529b3192602b790",
"name": "Lidl"
}
},
"charge": 6.0088
},
"summary": {
"duration": 2037,
"length": 11676,
"consumption": -14,
"baseDuration": 2037
},
"transport": {
"mode": "car"
}
},
{
"id": "86c67225-4fb8-47eb-b2e8-0bed93a55a7b",
"type": "vehicle",
"postActions": [
{
"action": "charging",
"duration": 960,
"consumablePower": 175,
"arrivalCharge": 9.32,
"targetCharge": 56
}
],
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.7649995,
"lng": 13.0261866,
"elv": 77
},
"id": "ZW06ZGQ3Mzk3MDVkMGYxZDFmZjQwNjUwOGE4NTU5YjY4Mjk",
"name": "Lidl Filiale Kremmen",
"attributes": {
"power": 50,
"current": 100,
"voltage": 500,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "62122cc124eb680ea529b3192602b790",
"name": "Lidl"
}
},
"charge": 24
},
"arrival": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.56798,
"lng": 13.3092763,
"elv": 77
},
"id": "ZW06MzBjMTkwNTg2NDJhMWQ2NDg0NWJjMDk1YzFkZWE1MDY",
"name": "ABBHP_0043",
"attributes": {
"power": 175,
"current": 438,
"voltage": 400,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "a960a4d02dd7b873d8a7c0cf99f09c39",
"name": "Shell Recharge"
}
},
"charge": 9.32
},
"summary": {
"duration": 2766,
"length": 40402,
"consumption": -32,
"baseDuration": 2766
},
"transport": {
"mode": "car"
}
},
{
"id": "6dd2590f-2c85-434c-8bd5-b97687239684",
"type": "vehicle",
"departure": {
"place": {
"type": "chargingStation",
"location": {
"lat": 52.56798,
"lng": 13.3092763,
"elv": 77
},
"id": "ZW06MzBjMTkwNTg2NDJhMWQ2NDg0NWJjMDk1YzFkZWE1MDY",
"name": "ABBHP_0043",
"attributes": {
"power": 175,
"current": 438,
"voltage": 400,
"supplyType": "dc",
"connectorType": "iec62196Type2Combo"
},
"brand": {
"hrn": "a960a4d02dd7b873d8a7c0cf99f09c39",
"name": "Shell Recharge"
}
},
"charge": 56
},
"arrival": {
"place": {
"type": "place",
"location": {
"lat": 51.7412356,
"lng": 14.3525337,
"elv": 115
},
"originalLocation": {
"lat": 51.741505,
"lng": 14.3524129
}
},
"charge": 4.8287
},
"summary": {
"duration": 5703,
"length": 141533,
"consumption": 51.1713,
"baseDuration": 5703
},
"transport": {
"mode": "car"
}
}
]
}
]
}