Long Distance EV Routing

Service version: 1
Last edit: 2025.03.25
TomTom Maps

Purpose

The Long Distance EV Routing service calculates a route between a given origin and destination, passing through waypoints if they are specified. The route contains charging stops that have been added automatically based on the vehicle's consumption and charging model.

  • The route considers factors such as the current traffic and the typical road speeds on the requested day of the week and time of day.
  • Information returned includes the distance, estimated travel time, a representation of the route geometry, and charging stops that have been added automatically based on the vehicle's consumption and charging model.
  • Each charging stop results in an additional leg in the route response.
  • Each additional leg contains a chargingInformationAtEndOfLeg element in its leg summary.
  • Both the route summary and the leg summary include a remainingChargeAtArrivalInkWh element.
  • The route summary includes a totalChargingTimeInSeconds element.

The chargingInformationAtEndOfLeg field consists of:

  • target battery charge
  • charging time
  • details about the charging stop

Run this endpoint

You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.

Deprecation notice

March 15, 2024

  • Value tollRoad for the input parameter sectionType as well as the respective response section type TOLL_ROAD have been deprecated.
  • This section will be withdrawn following a 12 months deprecation period.
  • The planned withdrawal date is March 15, 2025.
  • Following withdrawal, requests for toll road section may result in an HTTP 400 error in the response.

We recommend using toll and toll vignette sections instead.

Request data

HTTPS method: POST

  • Constants and parameters enclosed in curly brackets { } must be replaced with their values.

Generic request format

  • Please see the following Request parameters section with the required and optional parameters tables for their values. The generic request format is as follows.

URL example

post
URL request example
1https://{baseURL}/routing/{versionNumber}/calculateLongDistanceEVRoute/{routePlanningLocations}/json?key={Your_API_Key}
2&vehicleEngineType=electric
3&constantSpeedConsumptionInkWhPerHundredkm={ElectricConstantSpeedConsumptionPairs}
4&currentChargeInkWh={float}
5&maxChargeInkWh={float}
6&minChargeAtDestinationInkWh={float}
7&criticalMinChargeAtDestinationInkWh={float}
8&minChargeAtChargingStopsInkWh={float}
9&minChargeAtFirstChargingStopInkWh={float}
10&callback={callback}
11&alternativeType={alternativeType}
12&maxAlternatives={alternativeRoutes}
13&minDeviationDistance={integer}
14&minDeviationTime={integer}
15&vehicleHeading={integer}
16&sectionType={sectionType}
17&report={effectiveSettings}
18&departAt={time}
19&arriveAt={time}
20&traffic=true
21&avoid={avoidType}
22&prefer={preferType}
23&instructionsType={instructionsType}
24&language={language}
25&chargingStopsStrategy={chargingStopsStrategy}
26&vehicleMaxSpeed={vehicleMaxSpeed}
27&vehicleWeight={vehicleWeight}
28&vehicleAxleWeight={vehicleAxleWeight}
29&vehicleNumberOfAxles={vehicleNumberOfAxles}
30&vehicleLength={vehicleLength}
31&vehicleWidth={vehicleWidth}
32&vehicleHeight={vehicleHeight}
33&vehicleCommercial={boolean}
34&vehicleLoadType={vehicleLoadType}
35&vehicleAdrTunnelRestrictionCode={vehicleAdrTunnelRestrictionCode}
36&handsFreeDrivingCapability={handsFreeDrivingCapability}
37&accelerationEfficiency={float}
38&decelerationEfficiency={float}
39&uphillEfficiency={float}
40&downhillEfficiency={float}
41&consumptionInkWhPerkmAltitudeGain={float}
42&recuperationInkWhPerkmAltitudeLoss={float}
43&auxiliaryPowerInkW={float}
44&chargeMarginsInkWh={commaSeparatedFloats}

curl command example

post
Request curl command example
1curl -X POST 'https://api.tomtom.com/routing/1/calculateLongDistanceEVRoute/52.507,13.492:50.104,8.624/json?key={Your_API_Key}&vehicleEngineType=electric&constantSpeedConsumptionInkWhPerHundredkm=32,10.87:77,18.01&currentChargeInkWh=20&maxChargeInkWh=40&minChargeAtDestinationInkWh=4&criticalMinChargeAtDestinationInkWh=2&minChargeAtChargingStopsInkWh=4'\
2 -H 'Content-Type: application/json' -d '{
3 "chargingParameters": {
4 "batteryCurve": [
5 {
6 "stateOfChargeInkWh": 50.0,
7 "maxPowerInkW": 200
8 },
9 {
10 "stateOfChargeInkWh": 70.0,
11 "maxPowerInkW": 100
12 },
13 {
14 "stateOfChargeInkWh": 80.0,
15 "maxPowerInkW": 40
16 }
17 ],
18 "chargingConnectors": [
19 {
20 "currentType": "AC3",
21 "plugTypes": [
22 "IEC_62196_Type_2_Outlet",
23 "IEC_62196_Type_2_Connector_Cable_Attached",
24 "Combo_to_IEC_62196_Type_2_Base"
25 ],
26 "efficiency": 0.9,
27 "baseLoadInkW": 0.2,
28 "maxPowerInkW": 11
29 },
30 {
31 "currentType": "DC",
32 "plugTypes": [
33 "IEC_62196_Type_2_Outlet",
34 "IEC_62196_Type_2_Connector_Cable_Attached",
35 "Combo_to_IEC_62196_Type_2_Base"
36 ],
37 "voltageRange": {
38 "minVoltageInV": 0,
39 "maxVoltageInV": 500
40 },
41 "efficiency": 0.9,
42 "baseLoadInkW": 0.2,
43 "maxPowerInkW": 150
44 },
45 {
46 "currentType": "DC",
47 "plugTypes": [
48 "IEC_62196_Type_2_Outlet",
49 "IEC_62196_Type_2_Connector_Cable_Attached",
50 "Combo_to_IEC_62196_Type_2_Base"
51 ],
52 "voltageRange": {
53 "minVoltageInV": 500,
54 "maxVoltageInV": 2000
55 },
56 "efficiency": 0.9,
57 "baseLoadInkW": 0.2
58 }
59 ],
60 "chargingTimeOffsetInSec": 60
61 }
62}'

Types

The following table describes the types that can be used in the Long Distance EV Routing service.

TypeDescription

location string

Latitude, longitude pair (in EPSG:4326 projection), with the following constraints:

  • Latitude values must be in the range [-90, +90].

  • Longitude values must be in the range [-180, +180].

Example: 52.37245,4.89406

point object

A location represented as a JSON object to be used in the POST data only. The object should contain the two fields latitude and longitude each containing a number, and expressed in the same reference frame and with the same constraints as for the location type. Example: {"latitude": 52.37245, "longitude": 4.89406}

dateTime string

A date and time specified in RFC 3339 format with an optional time zone offset. Examples:

  • 2023-12-19T16:39:57
  • 2023-12-19T16:39:57-08:00

ElectricConstantSpeedConsumptionPair string (contains a pair of two, comma-separated floats)

Comma-separated speedInkmh,consumptionInkWhPerHundredkm pairs with the following constraint: The speedInkmh values must be in the range [0.0, 255.0]. Example: 15.5,8.0

commaSeparatedFloats

Comma-separated list of floats. Example: 1.23,0

Avoid parameter possible values

ValueDescription
tollRoads

Avoids toll roads.

motorways

Avoids motorways.

ferries

Avoids ferries.

unpavedRoads

Avoids unpaved roads.

carpools

Avoids routes that require use of carpool (HOV/High Occupancy Vehicle) lanes.

alreadyUsedRoads

Avoids using the same road multiple times.

borderCrossings

Avoids crossing country borders.

tunnels

Avoids tunnels.

carTrains

Avoids car trains.

lowEmissionZones

Avoids low-emission zones.

Possible values for other types

TypePossible values

plugType parameter value codes
This list may be extended in the future.

  • Small_Paddle_Inductive
  • Large_Paddle_Inductive
  • IEC_60309_1_Phase
  • IEC_60309_3_Phase
  • IEC_62196_Type_1_Outlet
  • IEC_62196_Type_2_Outlet
  • IEC_62196_Type_3_Outlet
  • IEC_62196_Type_1_Connector_Cable_Attached
  • IEC_62196_Type_2_Connector_Cable_Attached
  • IEC_62196_Type_3_Connector_Cable_Attached
  • Combo_to_IEC_62196_Type_1_Base
  • Combo_to_IEC_62196_Type_2_Base
  • Type_E_French_Standard_CEE_7_5
  • Type_F_Schuko_CEE_7_4
  • Type_G_British_Standard_BS_1363
  • Type_J_Swiss_Standard_SEV_1011
  • China_GB_Part_2
  • China_GB_Part_3
  • IEC_309_DC_Plug
  • AVCON_Connector
  • Tesla_Connector
  • NEMA_5_20
  • CHAdeMO
  • SAE_J1772
  • TEPCO
  • Better_Place_Socket
  • Marechal_Socket
  • Standard_Household_Country_Specific

facilityType parameter value codes

  • Battery_Exchange
  • Charge_100_to_120V_1_Phase_at_8A
  • Charge_100_to_120V_1_Phase_at_10A
  • Charge_100_to_120V_1_Phase_at_12A
  • Charge_100_to_120V_1_Phase_at_13A
  • Charge_100_to_120V_1_Phase_at_16A
  • Charge_100_to_120V_1_Phase_at_32A
  • Charge_200_to_240V_1_Phase_at_8A
  • Charge_200_to_240V_1_Phase_at_10A
  • Charge_200_to_240V_1_Phase_at_12A
  • Charge_200_to_240V_1_Phase_at_12A
  • Charge_200_to_240V_1_Phase_at_20A
  • Charge_200_to_240V_1_Phase_at_32A
  • Charge_200_to_240V_1_Phase_above_32A
  • Charge_200_to_240V_3_Phase_at_16A
  • Charge_200_to_240V_3_Phase_at_32A
  • Charge_380_to_480V_3_Phase_at_16A
  • Charge_380_to_480V_3_Phase_at_32A
  • Charge_380_to_480V_3_Phase_at_63A
  • Charge_50_to_500V_Direct_Current_at_62A_25kW
  • Charge_50_to_500V_Direct_Current_at_125A_50kW
  • Charge_200_to_450V_Direct_Current_at_200A_90kW
  • Charge_200_to_480V_Direct_Current_at_255A_120kW
  • Charge_Direct_Current_at_20kW
  • Charge_Direct_Current_at_50kW
  • Charge_Direct_Current_above_50kW

currentType parameter value codes

  • Direct_Current
  • Alternating_Current_1_Phase
  • Alternating_Current_3_Phase

paymentMethod parameter value codes

  • No_Payment
  • Subscription
  • Direct

Request headers

The following data table describes supported HTTP request headers.

  • Required headers must be used or the call will fail.
  • Optional headers may be used.
  • The order of request headers is not important.

Required headers

Description

Content-Type

Specifies the MIME type of the request body. Value: application/json

Optional headers

Description

Accept-Encoding

Requests that the response be compressed. Value: gzip

Content-Encoding

Specifies the compression used for the request body. Currently, only gzip is supported. If not specified, no compression is assumed. This is equal to specifying identity. Values:

  • identity
  • gzip
Tracking-ID

Specifies an identifier for the request.

  • The value should be unique for each request.
  • The value must match the regular expression '^[a-zA-Z0-9-_\.]{1,100}$'.

  • If specified, the same value is sent back in the similar-named response header. Otherwise, a generated value may be sent back.

Base path parameters

The following table describes the set of parameters that can be used in the Long Distance EV Routing service. Note that all the parameters are required and must be used, otherwise, the call will fail. The order of the required parameters is important and must be followed.

Required parameters

Description

baseURL string

Base URL for calling the API. Values:

  • api.tomtom.com: The default global API endpoint.

  • kr-api.tomtom.com: The region-specific endpoint for South Korea. See the Region-specific content documentation.

versionNumber integer

The service version number. Value: The current value is 1.

routePlanningLocations string

Locations through which the route is calculated. The following constraints apply:

  • At least two locations must be provided.
  • The first location in the sequence defines the origin and must be a location.

  • The last location in the sequence defines the destination and must be a location.

  • One or more optional intermediate locations (known as waypoints in this context) may be provided:

    • The maximum allowed number of waypoints is 150.
    • A waypoint of type location results in an extra leg in the response.

Values: Colon-delimited locations, with the constraints mentioned above.

contentType string

The only possible value for the Long Distance EV Routing service is json.

Request parameters

This section presents a set of loosely connected parameters that influence the operation of the Long Distance EV Routing algorithm. While some of them are associated, the majority can be used independently of the others. Note that the required parameters must be used or the call will fail. Optional parameters may be used. The order of the request parameters is not important.

Required parameters

Description

key string

Authorization key to access the API. Value: Your valid API Key.

vehicleEngineType string

This parameter has been deprecated. It may be removed in the future. Only allowed value: electric

currentChargeInKwh float

Specifies the current electric energy supply in kilowatt hours (kWh). Minimum value: 0.0
Maximum value: The vehicle's battery capacity defined by given maxChargeInkWh.

minChargeAtDestinationInkWh float

The battery level upon arrival at the destination of the resulting route will be at least this much. Minimum value: 0.0
Maximum value: Less than the vehicle's battery capacity defined by given maxChargeInkWh.

minChargeAtChargingStopsInkWh float

The desired minimum battery charge level upon arrival at each charging station. However, the remaining charge at the first charging stop may be lower. See minChargeAtFirstChargingStopInkWh for more information. Minimum value: 0.0
Maximum value: 0.5 × maxChargeInkWh

Optional parametersDescription

report string

Specifies which data should be reported for diagnostic purposes. A possible value is: effectiveSettings.

  • Reports the effective parameters or data used when calling the API.

  • In the case of defaulted parameters, the default will be reflected where the parameter was not specified by the caller.

Default value: effectiveSettings

departAt string

The date and time of departure from the origin point.

  • Departure times apart from now must be specified as a dateTime.

  • When a time zone offset is not specified, it is assumed to be that of the origin point.

  • The departAt parameter cannot be used in conjunction with arriveAt.

Default value: now
Other value: dateTime

arriveAt string

The date and time of arrival at the destination point.

  • It must be specified as a dateTime.

  • When a time zone offset is not specified, it is assumed to be that of the destination point.

The arriveAt parameter cannot be used in conjunction with:

  • departAt
  • minDeviationDistance
  • minDeviationTime
  • supportingPointIndexOfOrigin

Value: dateTime

routeType string

Specifies the type of optimization used when calculating routes. The only possible value in the Long Distance EV Routing service is fastest. Route calculation is optimized by travel time, while keeping the routes sensible. For example, the calculation may avoid shortcuts along inconvenient side roads or long detours that only save very little time.

traffic boolean

The only possible value for the Long Distance EV Routing service is true. With this value, all the available traffic information during routing will be considered.
Depending on availability, the Routing API takes road closures and road works into account that are up to 60 days in the future.

avoid string

Specifies something that the route calculation should try to avoid when determining the route. The avoid can be specified multiple times (e.g., ...&avoid=motorways&avoid=ferries&...). Possible values are listed under Avoid parameter possible values.

prefer string

Specifies something that the route calculation should try to prefer when determining the route. Possible value:

  • handsFreeDriving: Prefer stretches that allow for hands-free driving.

    • If this parameter is set, then handsFreeDrivingCapability must also be set.

handsFreeDrivingCapability string

Specifies the hands-free driving capability of the vehicle. The available hands-free driving data is matched against handsFreeDrivingCapability in order to filter for the subset of data that applies to the specific capability of the vehicle.

  • The value must match the regular expression '^[a-zA-Z0-9-:]{1,100}$'.

travelMode string

The mode of travel for the requested route.

  • Note that the requested travelMode may not be available for the entire route.

  • Where the requested travelMode is not available for a particular section, the travelMode field of the response for that section will be set to "other".

  • Full restriction data is not available in all areas.

Default value: car
Other values:

  • truck
  • bus
  • van
  • motorcycle

vehicleMaxSpeed integer

Maximum speed of the vehicle in kilometers/hour.

  • Must have a value in the range [0, 250].

  • A value of 0 means that an appropriate value for the vehicle will be determined and applied during route planning.

Default value: 0

vehicleWeight integer

Weight of the vehicle in kilograms.

  • This is required if any of the accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency parameters are set.

  • It must be strictly positive with a minimum value 1 when used in the context of the Electric Consumption model.

  • Weight restrictions are considered.

Default value: 0

vehicleAxleWeight integer

Weight per axle of the vehicle in kilograms. A value of 0 means that weight restrictions per axle are not considered.
Default value: 0

vehicleNumberOfAxles integer

Number of axle of the vehicle. A value of 0 means that the number of axle restrictions is not considered.
Default value: 0

vehicleLength float

Length of the vehicle in meters, including the length of any additional equipment, e.g., trailers, bike racks, etc. A value of 0 means that length restrictions are not considered. Fractional digits are rounded to the closest centimeter while rounding up on a tie.
Default value: 0

vehicleWidth float

Width of the vehicle in meters. A value of 0 means that width restrictions are not considered. Fractional digits are rounded to the closest centimeter while rounding up on a tie.
Default value: 0

vehicleHeight float

Height of the vehicle in meters. A value of 0 means that height restrictions are not considered. Fractional digits are rounded to the closest centimeter while rounding up on a tie.
Default value: 0

vehicleCommercial boolean

Vehicle is used for commercial purposes and thus may not be allowed to drive on some roads.
Default value: false

vehicleLoadType string

Specifies types of cargo that may be classified as hazardous materials and are restricted from some roads. The vehicleLoadType parameter can be specified multiple times (e.g.,

...&vehicleLoadType=USHazmatClass1&vehicleLoadType=USHazmatClass2&vehicleLoadType=USHazmatClass3&...

or

...&vehicleLoadType=otherHazmatExplosive&vehicleLoadType=otherHazmatHarmfulToWater&...

). Available values are:

  • US Hazmat classes 1 through 9
  • Generic classifications for use in other countries.

Use these values for routing in the USA:

  • USHazmatClass1: Explosives

  • USHazmatClass2: Compressed gas

  • USHazmatClass3: Flammable liquids

  • USHazmatClass4: Flammable solids

  • USHazmatClass5: Oxidizers

  • USHazmatClass6: Poisons

  • USHazmatClass7: Radioactive

  • USHazmatClass8: Corrosives

  • USHazmatClass9: Miscellaneous

Use these values for routing in all other countries:

  • otherHazmatExplosive: Explosives

  • otherHazmatGeneral: Miscellaneous

  • otherHazmatHarmfulToWater: Harmful to water

Notes: The vehicleLoadType and vehicleAdrTunnelRestrictionCode parameters are independent; please provide both if applicable.

vehicleAdrTunnelRestrictionCode string

If vehicleAdrTunnelRestrictionCode is specified, the vehicle is subject to ADR tunnel restrictions.

  • Vehicles with code B are restricted from roads with ADR tunnel categories B, C, D, and E.

  • Vehicles with code C are restricted from roads with ADR tunnel categories C, D, and E.

  • Vehicles with code D are restricted from roads with ADR tunnel categories D and E.

  • Vehicles with code E are restricted from roads with ADR tunnel category E.

  • If vehicleAdrTunnelRestrictionCode is not specified, no ADR tunnel restrictions apply.

Notes: The vehicleAdrTunnelRestrictionCode and vehicleLoadType parameters are independent; please provide both if applicable. Values (specify at most one):

  • B
  • C
  • D
  • E

Reference: European Agreement Concerning the International Carriage of Dangerous Goods by Road (ADR), United Nations, 2019, section 1.9.5 and chapter 8.6

vehicleHasElectricTollCollectionTransponder string

Specifies the route calculation should try to avoid ETC-transponder-only toll roads when determining the route if a vehicle does not have an ETC transponder. Possible values are:

  • all: Do not avoid ETC-transponder-only toll roads.
  • none: Avoids ETC-transponder-only toll roads.

If this parameter is not specified, ETC-transponder-only toll roads are not avoided.

coordinatePrecision string

Specifies the precision of coordinates in the response. Possible values are:

  • default: All coordinates are rounded to 5 digits after the decimal point. Default precision coordinates are targeted towards clients that are sensitive to response sizes. This should be sufficient for most applications.

  • full: All coordinates are rounded to 7 digits after the decimal point. Full precision coordinates are targeted towards applications that require precise polyline visualization at high zoom levels.

Default value: default
Other value: full

reconstructionMode string

Specifies how to reconstruct a given polyline or individual legs. Note: this parameter can only be used when a route or legs are provided as part of the request by using supportingPoints or encodedPolyline. For a description of supportingPoints and encodedPolyline see the Post Data section of this document. Possible values are:

  • normal: Some leeway is allowed when the provided polyline doesn't exactly match the road network, such that a most sensible route is reconstructed. Use this option in case the given polyline comes from a third party source such as a recorded track, a different routing service, or user input. Please consider using the track mode, it is newer and gives better results.

  • strict: Reconstruct the given route as close as possible to the given polyline. This might mean that some driving restrictions are violated in order to closely match the original route. Use this option when reconstructing a route previously received from this service.

  • track: This mode provides flexibility when the provided route polyline does not align well with the road network, allowing the reconstruction of the most sensible route. The input polyline may have inconsistencies such as gaps and loops. When reconstructing the route using track mode, the algorithm will try to respect the driving restrictions and consider traffic conditions. Use this mode when the given polyline originates from a third-party source such as a recorded track, a different routing service, or user input.

  • update: Reconstruct the given route as close as possible to the provided route polyline, ignoring time-dependent driving and legal restrictions in order to keep the input polyline geometry stable. The input polyline is expected to be normalized, without any loops or gaps. Use this option to refresh dynamic data, as required during navigating along your route. Notice: The resulting reconstructed route tries to accurately follow the road network and might result in an illegal route due to potential violation of driving restrictions.

Note: In any of the modes, the algorithm might relax certain restrictions near the origin and destination to offer a more sensible route instead of a no-route-found. This ensures that routes planned with our service can be reconstructed.
Default value: normal
Other values:

  • strict
  • track
  • update

In short, this table summarizes the differences between the modes and restrictions:

Mode / Restrictiontrafficno-throughtime-dependent
normal
strict
track
update

arrivalSidePreference string

Specifies the preference of roadside on arrival to waypoints and destination. Stop on the road has to be set at least two meters to the preferred side, otherwise the behavior will default to anySide. Possible values are:

  • anySide: Both sides of a road could be used to approach the waypoint and destination. When a vehicle arrives, a stop could be either on a left side or a right side.

  • curbSide: Ensures a minimal number of road crossings at waypoints or the destination. When a vehicle arrives, a stop should be on the right for the right-side driving road or on a left for the left-side driving road.

Default value: anySide
Other value: curbSide

maxAlternatives integer

Number of desired alternative routes to be calculated. Fewer alternative routes may be returned if either fewer alternatives exist, or the requested number of alternatives is larger than the service can calculate. Default value: 0
Maximum value: 5

alternativeType string

When maxAlternatives is greater than 0, it allows you to specify the objective of computing alternative routes and includes finding routes that are significantly different than the reference route, or finding routes that are better than the reference route. Possible values are:

  • anyRoute: returns alternative routes that are significantly different from the reference route.

  • betterRoute: only returns alternative routes that are better than the reference route, according to the given planning criteria (set by routeType). If there is a road block on the reference route, then any alternative that does not contain any blockages will be considered a better route. The summary in the route response will contain information (see the planningReason parameter) about the reason for the better alternative.

Note: The betterRoute value can only be used when reconstructing a reference route. Default value: anyRoute
Other values: betterRoute

minDeviationDistance integer

All alternative routes returned will follow the reference route (see the POST data parameters section) from the origin point of the calculateLongDistanceEVRoute request for at least this number of meters.

  • Can only be used when reconstructing a route.
  • The minDeviationDistance parameter cannot be used in conjunction with arriveAt.

Default value:0

minDeviationTime integer

All alternative routes returned will follow the reference route (see the POST data parameters section) from the origin point of the calculateLongDistanceEVRoute request for at least this number of seconds.

  • Can only be used when reconstructing a route.
  • The minDeviationTime parameter cannot be used in conjunction with arriveAt.

Default value:0

supportingPointIndexOfOrigin integer

Largest index in the array of supportingPoints per route or in joined arrays of supportingPoints per leg (see the POST data parameters section) for which supportingPoints[supportingPointIndexOfOrigin] lies on or before the origin point. The Routing API uses this index as a hint to disambiguate situations where the supportingPoints in the POST data are not planar, or where they come back close to the origin at a later point in the reconstructed route. In these cases, the supportingPointIndexOfOrigin can explicitly identify if the origin is meant to be on the later part of the route, or not.

  • Can only be used when reconstructing a route.
  • Cannot be used in conjunction with arriveAt.

Minimum value: 0
Maximum value: One less than the size of supportingPoints array.

routeRepresentation string

Specifies the representation of the set of routes provided as a response. Possible values are:

  • polyline: Includes routes in the response as polylines. The polylines are returned in the points fields in the response.

  • encodedPolyline: Includes routes in the response in the encoded polyline format. The encoded polylines are returned in the encodedPolyline fields and their precisions in the encodedPolylinePrecision fields in the response.

  • summaryOnly: As per polyline, but excluding the points fields for the routes in the response.

Default value: polyline
Other values:

  • encodedPolyline
  • summaryOnly

vehicleHeading integer

The directional heading of the vehicle, in degrees starting at true North and continuing in a clockwise direction.

  • North is 0 degrees.
  • East is 90 degrees.
  • South is 180 degrees.
  • West is 270 degrees.

Maximum value: 359
Other values: 0-359
Note: The vehicle heading is ignored when doing the base route reconstruction if reconstructionMode is set to strict or update.

sectionType string

Specifies which of the section types is reported in the route response. sectionType can be specified multiple times (e.g., ...&sectionType=tollRoad&sectionType=tollVignette&...). Possible values are:

  • carTrain: sections of the route that are car trains.

  • ferry: sections of the route that are ferries.

  • tunnel: sections of the route that are tunnels.

  • motorway: sections of the route that are motorways.

  • pedestrian: sections of the route that are only suited for pedestrians.

  • tollRoad: sections of the route that require a toll to be paid.

  • toll: sections of the route with the usage-based toll collection system (i.e., distance-based tolls, toll bridges and tunnels, weight-based tolls).

  • tollVignette: sections of the route that require a toll vignette to be present.

  • country: sections indicating which countries the route is in.

  • travelMode: sections in relation to the request parameter travelMode.

  • traffic: sections of the route that contain traffic information.

  • carpool: sections of the route that require use of carpool (HOV/High Occupancy Vehicle) lanes.

  • urban: sections of the route that are located within urban areas.

  • unpaved: sections of the route that are unpaved.

  • lowEmissionZone: sections of the route that are located within low-emission zones.

  • roadShields: sections with road shield information. A road shield section contains roadShieldReferences, which is a list of references for the road shields (roadShieldReference). Please refer to the structure of a road shield reference object for further information.
    Notes: If this section type is requested, calculateRouteResponse contains the additional field roadShieldAtlasReference. Please refer to the notes about the road shield atlas for further information. The road shields are only available in these supported countries.

  • speedLimit: Sections with legal speed limit information. maxSpeedLimitInKmh: The maximum legal speed limit in kilometers/hour. This can be time-dependent and/or vehicle-dependent.

    • Time can be set by either the departAt or the arriveAt request parameters. In the case of a time-dependent speed limit, the section will contain the speed limit effective at the time the planned route would enter this section.

    • Vehicle information can be set by adjusting the travelMode and vehicle* request parameters.

    • Requesting legal speed limits is only valid if travelMode is adjusted to be a motorized vehicle ( car, truck, bus, van, or motorcycle).

  • handsFreeDriving: Sections of the route applicable for hands-free driving.

    • Note: If this parameter is set, then the parameter handsFreeDrivingCapability must also be set.

    • Note: If this parameter is set, and the parameter prefer=handsFreeDriving is not set, the response may contain hands-free sections, but the route will not prefer stretches that allow hands-free driving.

  • importantRoadStretch: Sections with important stretches of road information. importantRoadStretch provides a set of street names and/or a set of road numbers that allow the driver to identify and distinguish the course of the route (from other potential routes).

Default value:travelMode

includeTollPaymentTypes string

Include toll payment types in the toll section. If a toll section has different toll payment types in its subsections, this toll section splits into multiple toll sections with the toll payment types. Possible values:

  • all: Include toll payment types in the toll section.
  • none: Do not include toll payment types in the toll section.

The value all must be used together with sectionType=toll. Default value: none

chargeMarginsInkWh comma-separated floats

Specifies a list of margins in kilowatt-hours (kWh) for computing reachableRouteOffsets.

  • Can only be used when all of constantSpeedConsumptionInkWhPerHundredkm, maxChargeInkWh, and currentChargeInkWh are specified.

  • The items in the list must be in strictly decreasing order.
  • The list is restricted to exactly one item.

Minimum value: 0
Maximum value: 0

extendedRouteRepresentation string

Specifies the extended representation of the set of routes provided as a response. <extendedRouteRepresentation> can be specified multiple times (e.g., ...&extendedRouteRepresentation=distance&extendedRouteRepresentation=travelTime&extendedRouteRepresentation=consumption&... ). <extendedRouteRepresentation> can only be specified when contentType is json and routeRepresentation is polyline or encodedPolyline. Possible values are:

  • distance: Includes distances to route polyline points in the response.

  • travelTime: Includes travel times to route polyline points in the response.

  • consumption: Includes consumption values to route polyline points in the response.

    • Can only be used when the constantSpeedConsumptionInkWhPerHundredkm is specified.

chargingStopsStrategy string

This feature allows EV drivers to manually choose the charging stops along their itinerary, while optimizing charging times for minimal Estimated Travel Time (ETT). Possible values are:

  • automaticFastest: The service automatically generates charging stops that minimize the total ETT, including charging time.

  • manualFastest: The service does not add charging stops to the route.

    • It calculates the fastest route visiting charging and non-charging waypoints, optimizing charging times at the former to minimize the total ETT, with respect of the minimal charge at charging stops and destination when possible.
    • Since no additional charging stops are added to the route, it may happen that arrival charges at waypoints and destination are below the corresponding minimal charge, or even null or negative.
    • When a charging stop or the destination is unreachable, the target charge at the previous charging stop, when it exists, is set to 100% of the vehicle's charge capacity.

Default value: automaticFastest
For both values, charging waypoints are specified by adding their coordinates in the locations part of the URL and their charging park IDs in the corresponding chargingWaypoints item of the post data.

minChargeAtFirstChargingStopInkWh float

The desired minimum battery charge level upon arrival at the first charging station. If this parameter is not provided, an internal formula determines its value to allow route calculations with low current charge.
Minimum value: 0.0
Maximum value: minChargeAtChargingStopsInkWh

criticalMinChargeAtDestinationInkWh float

Upon arrival at the destination, the minimum battery charge level may be reduced to this value if it allows the planning of a route without any charging stops. For example, if the driver has a personal home charger and sets the home as the destination, it could be okay to arrive there with a charge level lower than minChargeAtDestinationInkWh


Minimum value:0.0
Maximum value:minChargeAtDestinationInkWh
Default value:minChargeAtDestinationInkWh

language string

The language parameter determines the language of the returned names of places in general and also of the messages and phonetic translations in guidance.

  • Proper nouns (the names of streets, plazas, etc.) are returned in the specified language, or if that is not available, they are returned in an available language that is close to it.

  • The currently supported languages are listed on the Supported Languages page. The allowed values for the language parameter are the IETF language tags (or abbreviations in some cases) provided there.

Default value:en-GB

POST data parameters

Some parameters are provided using the HTTP POST method.

  • The POST data should be in JSON format, see the Content-Type header.
  • The POST data body must contain either a chargingParameters field (recommended charging model) or a chargingModes field (legacy charging model). It may also contain other fields such as reassessmentParameterSets, supportingPoints, encodedPolyline, etc., that are defined and explained in the upcoming subsections.

There is an upper limit on the total size of the POST data.

  • Exceeding this limit results in a response with the response code 413, indicating invalid POST data.
  • The client must not rely on the exact value of this limit.
  • The current limit is 10 MB.

Charging parameters and charging modes fields are respectively defined in the following two subsections.

ChargingParameters

The following tables show required and optional charging parameters, respectively:

Required parameters

Description

batteryCurve array

A piecewise-constant function which maps a state of charge (SoC) of a battery to the maximum charging power supported for this state of charge. It is used to compute the charging times of the vehicle. It must contain zero to up to 20 (inclusive) JSON objects each containing the properties stateOfChargeInkWh and maxPowerInkW. The stateOfChargeInkWh of each entry in the curve defines the lower bound (included) of the half-open interval this maximum charging power applies to, with the possible exception of the interval corresponding to the lowest SoC, which is implicitly extended towards a state of charge of 0.
The following requirements must be fulfilled:

  • stateOfChargeInkWh must be larger than or equal to zero.

  • None of the stateOfChargeInkWh values from such an object may equal the stateOfChargeInkWh value of any other object.

  • maxPowerInkW must be larger than zero.

If an empty curve is provided, the charging power will be limited solely by the maximum power of the specified connectors and the charging facility's supported charging power.

chargingConnectors array

Must be a non-empty array of chargingConnector elements. No chargingConnector may be equivalent to another, where equivalent chargingConnector elements:

  • have the same currentType

  • share at least one element of plugTypes

  • have an overlapping voltageRange

chargingConnector.currentType string

One of the values AC1, AC3 for single- or three-phase alternating current, or DC for direct current.

chargingConnector.plugTypes array of plugType

A non-empty list of plugType elements. See the plugType values table for possible values of plugType.

Optional parameters

Description

chargingTimeOffsetInSec integer

A constant time offset in seconds added to the computed charging time at each charging stop planned along the route. If not specified, the default value 60 applies. It must be larger than or equal to zero.

chargingConnector.efficiency float

Optional efficiency factor applied to the power provided by a charging facility and the maximum charging power for each point of the battery charging curve. If not specified, the default value 1.0 applies. It must be larger than zero and smaller than or equal to one.

chargingConnector.baseLoadInkW float

An optional base load considered when determining the available charging power. The base load is subtracted from the power provided by the charging facility prior to applying the efficiency factor. If not specified, the default value 0.0 applies. It must be larger than zero.

chargingConnector.maxPowerInkW float

Sets an upper limit for the charging power. The resulting charging power is the minimum of the charging power supported by the respective charging facility and this value. It must be a positive number or zero, where 0 implies the power is only limited by the charging facility. If not specified, the default value of 0 applies.
Note: If a non-empty battery charging curve is specified, a potentially lower maximum charging power at a given state of charge according to the curve takes precedence over the maximum power specified here when calculating the predicted charging time.

chargingConnector.maxVoltageInV float

Sets an upper limit for the voltage when charging. The resulting voltage is the minimum of the voltage supported by the respective charging facility and this value. It must be a positive number or zero, where 0 implies the voltage is only limited by the charging facility. If not specified, the default value of 0 applies.

chargingConnector.maxCurrentInA float

Sets an upper limit for the current when charging. The resulting amperage is the minimum of the amperage supported by the respective charging facility and this value. It must be a positive number or zero, where 0 implies the amperage is only limited by the charging facility. If not specified, the default value of 0 applies.

chargingConnector.voltageRange object

Specifies a voltage range as a right-open interval for the connector, defaulting to the range [0, infinity) if not specified. It must contain the fields minVoltageInV and maxVoltageInV specifying minimal (included) and maximal (excluded) voltage values.

  • minVoltageInV must be a positive number or zero.

  • maxVoltageInV must be a number greater than minVoltageInV or 0, which is treated as infinity.

Note: Explicitly specifying the voltage range of a connector may be necessary when the vehicle supports multiple connectors with the same current type (typically DC) and plug type, with each connector supporting different maximum charging powers depending on the voltage.

An example to POST request for charging parameters is as follows:

post
POST ChargingParameters format - JSON
1 {
2 [...],
3 "chargingParameters": {
4 "batteryCurve": [
5 {
6 "stateOfChargeInkWh": 50.0,
7 "maxPowerInkW": 200
8 },
9 {
10 "stateOfChargeInkWh": 70.0,
11 "maxPowerInkW": 100
12 },
13 {
14 "stateOfChargeInkWh": 80.0,
15 "maxPowerInkW": 40
16 }
17 ],
18 "chargingConnectors": [
19 {
20 "currentType": "AC3",
21 "plugTypes": [
22 "IEC_62196_Type_2_Outlet",
23 "IEC_62196_Type_2_Connector_Cable_Attached",
24 "Combo_to_IEC_62196_Type_2_Base"
25 ],
26 "efficiency": 0.9,
27 "baseLoadInkW": 0.2,
28 "maxPowerInkW": 11
29 },
30 {
31 "currentType": "DC",
32 "plugTypes": [
33 "IEC_62196_Type_2_Outlet",
34 "IEC_62196_Type_2_Connector_Cable_Attached",
35 "Combo_to_IEC_62196_Type_2_Base"
36 ],
37 "voltageRange": {
38 "minVoltageInV": 0,
39 "maxVoltageInV": 500
40 },
41 "efficiency": 0.9,
42 "baseLoadInkW": 0.2,
43 "maxPowerInkW": 150
44 },
45 {
46 "currentType": "DC",
47 "plugTypes": [
48 "IEC_62196_Type_2_Outlet",
49 "IEC_62196_Type_2_Connector_Cable_Attached",
50 "Combo_to_IEC_62196_Type_2_Base"
51 ],
52 "voltageRange": {
53 "minVoltageInV": 500,
54 "maxVoltageInV": 2000
55 },
56 "efficiency": 0.9,
57 "baseLoadInkW": 0.2
58 }
59 ],
60 "chargingTimeOffsetInSec": 60,
61 "preferredMSPs": ["Shell Recharge", "MyEasyCharge"]
62 }

ChargingModes

The following table shows required and optional charging modes, respectively:

Required parametersDescription

facilityType string

A string matching a facilityType in the following facilityType values table.

plugType string

A string matching a plugType in the following plugType values table.

chargeInkWh float

A battery charge level in kWh.
Minimum value: 0 Maximum value: 100000.0

timeToChargeInSeconds integer

A time span in seconds. A non-negative integer.

chargingCurveSupportPoint object

A supporting point of a charging curve consisting of chargeInkWh and timeToChargeInSeconds such that the time it takes to charge the battery from 0kWh to chargeInkWh kWh is given by timeToChargeInSeconds.

chargingCurve array

A piecewise-linear function which maps a target charge level to the time it takes to charge an empty battery to this level, that is used to compute charging times of the vehicle.

  • It is given by a sequence of at most 10 non-duplicate chargingCurveSupportPoints that are totally, increasingly ordered in timeToChargeInSeconds and chargeInkWh.

  • The last chargeInkWh is maxChargeInkWh.
  • The curve is given by connecting the given points in order after adding the first point:

    Creating a curve
    1{
    2 "chargeInkWh": 0.0,
    3 "timeToChargeInSeconds": 0
    4}

chargingConnection object

Contains one facilityType and one plugType which are compatible with the vehicle.

chargingConnections array

A non-empty list of at most 20 unique chargingConnections which result in the same charging curve.

chargingMode object

Contains chargingConnections and a chargingCurve that describes the charging behavior of the vehicle using the specified charging connections.

chargingModes array

A non-empty list of at most 10 chargingModes, which the vehicle is able to use to charge. Each chargingConnection appears in at most one chargingMode.

An example POST request for charging modes is as follows:

post
POST ChargingModes format
1 {
2 [...],
3 "chargingModes" : [
4 {
5 "chargingConnections" : [
6 {"facilityType" : "Charge_200_to_240V_1_Phase_at_32A", "plugType" : "CHAdeMO"},
7 {"facilityType" : "Charge_380_to_480V_3_Phase_at_16A", "plugType" : "CHAdeMO"}
8 ],
9 "chargingCurve" : [
10 {"chargeInkWh" : 1.0, "timeToChargeInSeconds" : 300},
11 {"chargeInkWh" : 2.1, "timeToChargeInSeconds" : 500},
12 {"chargeInkWh" : 10.0, "timeToChargeInSeconds" : 3100}
13 ]
14 },
15 {
16 "chargingConnections" : [
17 {"facilityType" : "Charge_200_to_240V_1_Phase_at_10A", "plugType" : "Standard_Household_Country_Specific"},
18 {"facilityType" : "Charge_100_to_120V_1_Phase_at_16A", "plugType" : "CHAdeMO"}
19 ],
20 "chargingCurve" : [
21 {"chargeInkWh" : 1.0, "timeToChargeInSeconds" : 600},
22 {"chargeInkWh" : 3.0, "timeToChargeInSeconds" : 2000},
23 {"chargeInkWh" : 10.0, "timeToChargeInSeconds" : 8000}
24 ]
25 },
26 "reassessmentParameterSets" : [
27 {"auxiliaryPowerInkW" : 0.3}
28 ]
29 ]
30 }

Other POST parameters

The supportingPoints field is used to reconstruct a route. This route is then used as a reference route for route reassessment, or calculating zero or more alternative routes.

  • The provided sequence of supporting points is used as input for route reconstruction.
  • The pointWaypoints field is used to represent waypoints when reconstructing a route.
  • The alternative routes are calculated between the origin and destination points specified in the routePlanningLocations, passing through all intermediate locations specified in the pointWaypoints field.
  • If supportingPointIndexOfOrigin is not used, and both minDeviationDistance and minDeviationTime are set to zero, then these origin and destination points are expected to be at (or very near) the beginning and end of the reference route, respectively.
  • The reference route may contain traffic incidents of type ROAD_CLOSURE, which are ignored for the calculation of the reference route's travel time and traffic delay.

Using supportingPointIndexOfOrigin, or setting at least one of minDeviationDistance or minDeviationTime to a value greater than zero, has the following consequences:

  • The origin point of the calculateLongDistanceEVRoute request must be on (or very near) the input reference route.
  • If this is not the case, an error is returned.
  • However, the origin point does not need to be at the beginning of the input reference route (it can be thought of as the current vehicle position on the reference route).
  • If used, supportingPointIndexOfOrigin must precisely indicate the location of the origin point in relation to the supportingPoints.
  • The reference route, returned as the first route in the calculateLongDistanceEVRoute response, will start at the origin point specified in the calculateLongDistanceEVRoute request. The initial part of the input reference route up until the origin point will be excluded from the response.
  • The values of minDeviationDistance and minDeviationTime determine how far alternative routes will be guaranteed to follow the reference route from the origin point onwards.
  • The vehicleHeading is ignored.

The calculateLongDistanceEVRoute endpoint accepts requests with user defined (manual) waypoints to visit. A manual waypoint is specified by its coordinates and needs to be added to routePlanningLocations of the request path. A subset of such manually added waypoints can be marked as charging stops by extending the POST data body with the chargingWaypoints parameter. The details, such as the charging park unique identifier (UUID), of all the charging stops in the locations list must be provided under this parameter. If the charging stop details are not provided then the location is considered as a non-charging waypoint.

The following table describes the set of common POST request parameters that can be used in the Long Distance EV Routing service. All of them are optional.

Parameter

Description

avoidVignette array

This is an array of strings. Each string should be a 3-character, ISO 3166-1, alpha-3 country code.

  • The array describes the countries in which all toll roads with vignettes are to be avoided.

  • Toll roads with vignettes in countries not in the array are unaffected.

Note: It is an error to specify both avoidVignette and allowVignette.

allowVignette array

This is an array of strings. Each string should be a 3-character, ISO 3166-1, alpha-3 country code.

  • The array describes the countries in which toll roads with vignettes are allowed.

  • Specifying allowVignette with an array of countries is equivalent to specifying avoidVignette with the array of all countries other than those specified in allowVignette.

  • Specifying allowVignette with an empty array is the same as avoiding all toll roads with vignettes.

Note: It is an error to specify both avoidVignette and allowVignette.

supportingPoints array of point objects

An array of point objects, to be used as input for route reconstruction. supportingPoints and encodedPolyline are alternative representation formats and cannot be used simultaneously. See the Route geometry representation formats section for further information.

encodedPolyline string

A string in the Encoded polyline format representing the array of points to be used as input for route reconstruction. The precision used to encode the polyline must be set in the encodedPolylinePrecision field. supportingPoints and encodedPolyline are alternative representation formats and cannot be used simultaneously. See the Route geometry representation formats section for further information.

encodedPolylinePrecision integer

The precision used to encode the polyline in the encodedPolyline field.

  • Must be 5 or 7.
  • Must be paired with encodedPolyline.
pointWaypoints

An array of pointWaypoint objects, to be used to represent waypoints when reconstructing a route.

  • If specified, the array must not be empty.

  • If specified, all location waypoints in the routePlanningLocations will be ignored.

pointWaypoint

Contains one waypointSourceType and one supportingPointIndex object. See the pointWaypoints section for more details.

chargingWaypoints

A list of one or more chargingWaypoint elements. Note that:

  • Two consecutive chargingWaypoint elements should have waypointIndex values in ascending order.

  • Two consecutive chargingWaypoint elements with consecutive waypointIndex values should not have the same chargingParkId.

chargingWaypoint object

A chargingWaypoint object describes charging stop details. It contains: a waypointIndex and a chargingParkId. The details, such as the charging park unique identifier (UUID), of all the charging stops in the locations list must be provided under this parameter. If the charging stop details are not provided then the location is considered as a non-charging waypoint. See the chargingWaypoints section for more details.

reassessmentParameterSets

An array of reassessmentParameterSet objects, to be used as input for route reassessment.

  • Route reassessment provides information on how some properties of the route would be different with different input values (note that reassessment does not affect the shape of the route). For example, route reassessment can be used to quantify the impact of air conditioning use on total power consumption.

  • If specified, the array must contain exactly one entry.
  • A reassessmentParameterSet object is a set of parameters used together to reassess the planned route. Such an object must contain at least one parameter; currently the only supported parameter is auxiliaryPowerInkW.

legs array

An array of objects with the parameters for the computation of each leg. If the parameter is such that it is available for use in the query parameters, then its simultaneous use in the query parameters and in the POST data is prohibited, and such a request will be returned with an error. If the legs field is present in the POST data, then the number of elements in the array must be equal to the number of waypoints + 1. If there is no need to specify any parameters for some leg, then an empty object must be specified. In the context of calculateLongDistanceEvRoute it may only contain the routeStop field.

avoidChargingParks array of strings

A non-empty list of UUIDs of charging parks to avoid in the route. You can specify up to 40 charging parks to be avoided. Every element must follow the format specified in RFC4122. This is a soft avoid, i.e., a route with avoided parks is returned if no other route can be found.

preferChargingParkOperators array of strings

A list of unique preferred operators to use in the route. You can specify up to 20 preferred operators.

avoidChargingParkOperators array of strings

A list of unique operators to avoid in the route. You can specify up to 40 operators to be avoided. This is a soft avoid, i.e., a route with avoided operators is returned if no other route can be found.

preferredPlugAndChargeProviders array of strings

A non-empty JSON array of unique Plug-and-Charge Providers. The charging parks with these providers are preferred if there is a connector available that supports Plug-and-Charge. You can specify up to 20 Plug-and-Charge preferred providers. Each string can be up to 40 letters long.

preferredMSP string

The name of the preferred Mobility Service Provider (MSP). It can be up to 40 characters long.

preferredMSPs array

A non-empty JSON array of one or more preferredMSP elements. The specified Mobility Service Providers (MSPs) will be given a precedence over other MSPs during route search. The MSPs supported at a charging park can be seen in the response in the brand field of a chargingParkPaymentOption. Note that:

  • The preferredMSP elements should be unique.

  • The number of preferredMSP elements should not exceed 20.

chargingDestination object

Must contain a chargingParkId field. Please see Calculating Long Distance EV Route with a charging park as the final destination section for more details.

routeStop object

Specifies additional parameters for the stop at the end of the current leg. See route stop for details.

routeStop

Optional parameters

Description

pauseTimeInSeconds integer

Specifies the waiting time at route stops (including charging time). It must be 0 in the last leg (the destination). Default value: 0

entryPoints array of EntryPoint objects

Specifies the entry points for the stop at the end of the current leg. The route to the stop is calculated based on these entry points. Entries with the same location are not allowed.

entryPoint

Parameters

Description

latitude float

Latitude of the entry point. Required.

longitude float

Longitude of the entry point. Required.

pointWaypoints

Required parameters

Description

waypointSourceType string

Denotes the source of the waypoint. Possible values:

  • USER_DEFINED: a waypoint that was explicitly defined by the user.

  • AUTO_GENERATED: a waypoint that was defined by the system (e.g., the charging stop that was provided as a result of the LDEV route enhancement).

supportingPointIndex

An index into the supportingPoints array that denotes the location of the waypoint on the reference route.

  • Must be inside supportingPoints array boundaries.

Optional parameters

Description

chargingInformationAtWaypoint object

Specified if the waypoint is a charging stop. Must contain the fields chargingConnectionInfo, chargingParkUuid, chargingTimeInSeconds, and targetChargeInkWh.

  • chargingConnectionInfo must contain chargingPlugType and may contain chargingCurrentType, chargingPowerInkW ,chargingVoltageInV, and chargingCurrentInA

An example POST request for point waypoints is as follows:

post
POST PointWaypoints format
1 {
2 [...],
3 "supportingPoints": [
4 {"latitude": 52.50930, "longitude": 13.42936},
5 {"latitude": 52.50844, "longitude": 13.42859},
6 {"latitude": 52.50764, "longitude": 13.42752}
7 ],
8 "pointWaypoints": [
9 {
10 "waypointSourceType": "AUTO_GENERATED",
11 "supportingPointIndex": 1,
12 "chargingInformationAtWaypoint": {
13 "chargingParkUuid": "ffffffff-bcd3-2fa5-0000-000000153b86",
14 "targetChargeInkWh": 40.0,
15 "chargingTimeInSeconds": 1800,
16 "chargingConnectionInfo": {
17 "chargingPlugType": "Combo_to_IEC_62196_Type_2_Base",
18 "chargingCurrentType": "Direct_Current",
19 "chargingPowerInkW": 25.0,
20 "chargingVoltageInV": 400.0,
21 "chargingCurrentInA": 62.0
22 }
23 }
24 }
25 ]
26 }

chargingWaypoints

Required parameters

Description

waypointIndex integer

A positive integer depicting the charging waypoint's index in the route planning locations list. Must be in the range 1-150.

chargingParkId string

A non-blank string depicting the ID of the charging park, which is at the index waypointIndex in the locations list. The user can retrieve this ID from the TomTom EV Search.

An example POST request for charging waypoints is as follows:

post
POST ChargingWaypoints format
1 {
2 [...],
3 "chargingWaypoints": [
4 {
5 "waypointIndex": 1,
6 "chargingParkId": "64470d9f-100f-3c41-5d48-d2a500153b86"
7 }
8 ]
9 }

Request content example

Note: for the purpose of brevity the following example may contain fields that are incompatible with others, and in practice only a subset of them will be present in the request.

post
Request content example
1 {
2 "chargingParameters": {
3 "batteryCurve": [
4 {
5 "stateOfChargeInkWh": 50.0,
6 "maxPowerInkW": 200
7 },
8 {
9 "stateOfChargeInkWh": 70.0,
10 "maxPowerInkW": 100
11 },
12 {
13 "stateOfChargeInkWh": 80.0,
14 "maxPowerInkW": 40
15 }
16 ],
17 "chargingConnectors": [
18 {
19 "currentType": "AC3",
20 "plugTypes": [
21 "IEC_62196_Type_2_Outlet",
22 "IEC_62196_Type_2_Connector_Cable_Attached",
23 "Combo_to_IEC_62196_Type_2_Base"
24 ],
25 "efficiency": 0.9,
26 "baseLoadInkW": 0.2,
27 "maxPowerInkW": 11
28 },
29 {
30 "currentType": "DC",
31 "plugTypes": [
32 "IEC_62196_Type_2_Outlet",
33 "IEC_62196_Type_2_Connector_Cable_Attached",
34 "Combo_to_IEC_62196_Type_2_Base"
35 ],
36 "voltageRange": {
37 "minVoltageInV": 0,
38 "maxVoltageInV": 500
39 },
40 "efficiency": 0.9,
41 "baseLoadInkW": 0.2,
42 "maxPowerInkW": 150
43 },
44 {
45 "currentType": "DC",
46 "plugTypes": [
47 "IEC_62196_Type_2_Outlet",
48 "IEC_62196_Type_2_Connector_Cable_Attached",
49 "Combo_to_IEC_62196_Type_2_Base"
50 ],
51 "voltageRange": {
52 "minVoltageInV": 500,
53 "maxVoltageInV": 2000
54 },
55 "efficiency": 0.9,
56 "baseLoadInkW": 0.2
57 }
58 ],
59 "chargingTimeOffsetInSec": 60
60 },
61 "avoidChargingParks": ["{uuid1}", "{uuid2}", {...}, "{uuidN}"],
62 "preferChargingParkOperators": ["{id1}", "{id2}", {...}, "{idN}"],
63 "avoidChargingParkOperators": ["{id1}", "{id2}", {...}, "{idN}"],
64 "preferredPlugAndChargeProviders": ["{PnC1}", "{PnC2}", {...}, "{PnCN}"]
65 "preferredMSPs": ["Shell Recharge", "MyEasyCharge"],
66 "supportingPoints": [
67 {"latitude": 52.50930, "longitude": 13.42936},
68 {"latitude": 52.50844, "longitude": 13.42859},
69 {"latitude": 52.50764, "longitude": 13.42752}
70 ],
71 "encodedPolyline": "ogcph^_esc_GnxOf`N~rNv{S",
72 "encodedPolylinePrecision": 7,
73 "pointWaypoints": [
74 {
75 "waypointSourceType": "AUTO_GENERATED",
76 "supportingPointIndex": 1,
77 "chargingInformationAtWaypoint": {
78 "chargingParkUuid": "ffffffff-bcd3-2fa5-0000-000000153b86",
79 "targetChargeInkWh": 40.0,
80 "chargingTimeInSeconds": 1800,
81 "chargingConnectionInfo": {
82 "chargingPlugType": "Combo_to_IEC_62196_Type_2_Base",
83 "chargingCurrentType": "Direct_Current",
84 "chargingPowerInkW": 25.0,
85 "chargingVoltageInV": 400.0,
86 "chargingCurrentInA": 62.0
87 }
88 }
89 }
90 ],
91 "chargingWaypoints": [
92 {
93 "waypointIndex": 1,
94 "chargingParkId": "{uuid}"
95 }
96 ],
97 "chargingDestination":
98 {
99 "chargingParkId": "{uuid}"
100 },
101 "legs": [
102 {
103 "routeStop": {
104 "pauseTimeInSeconds": 610,
105 "entryPoints": [
106 {
107 "latitude": 52.50601,
108 "longitude": 13.42742
109 }
110 ]
111 }
112 },
113 {
114 }
115 ]
116 }

Consumption and charging models

The following data table describes all the parameters that can be specified in a request using the Electric model.

  • Required parameters must be used or the call will fail.
  • Optional parameters may be used.
  • The order of parameters in a request is not important.
  • The vehicleEngineType parameter must be electric to be able to use calculateLongDistanceEVRoute.

Required parameters

Description

constantSpeedConsumptionInkWhPerHundredkm
Colon-delimited list of ElectricConstantSpeedConsumptionPair

Specifies the speed-dependent component of consumption.

  • Provided as an unordered list of speed/consumption-rate pairs.

  • The list defines points on a consumption curve.

Consumption rates for speeds not in the list are found as follows:

  • By linear interpolation, if the given speed lies in between two speeds in the list.

  • By linear extrapolation otherwise, assuming a constant (ΔConsumption/ΔSpeed) determined by the nearest two points in the list.

The list must contain between 1 and 25 points (inclusive), and may not contain duplicate points for the same speed.

  • If it only contains a single point, then the consumption rate of that point is used without further processing.

  • Consumption specified for the largest speed must be greater than or equal to that of the penultimate largest speed. This ensures that extrapolation does not lead to negative consumption rates.

  • Similarly, consumption values specified for the two smallest speeds in the list cannot lead to a negative consumption rate for any smaller speed. The minimum and maximum values described here refer to the valid range for the consumption values (expressed in kWh/100km).

Minimum value: 0.01
Maximum value: 100000.0

Optional parameters

Description

maxChargeInkWh float

Specifies the maximum electric energy supply in kilowatt hours (kWh) that may be stored in the vehicle's battery. Note: Requires currentChargeInkWh to be set. Minimum value: currentChargeInkWh

auxiliaryPowerInkW float

Specifies the amount of power consumed for sustaining auxiliary systems, in kilowatts (kW). It can be used to specify consumption due to devices and systems such as AC systems, radio, heating, etc.
Minimum value: 0.0

accelerationEfficiency float

Specifies the efficiency of converting electric energy to kinetic energy when the vehicle accelerates (i.e., KineticEnergyGained/ ElectricEnergyConsumed). Notes:

  • It must be paired with decelerationEfficiency.
  • It cannot be used with consumptionInkWhPerkmAltitudeGain or recuperationInkWhPerkmAltitudeLoss.

Minimum value: 0.0
Maximum value: 1/decelerationEfficiency

decelerationEfficiency float

Specifies the efficiency of converting kinetic energy to electric energy when the vehicle decelerates (i.e., ElectricEnergyGained/ KineticEnergyLost). Notes:

  • It must be paired with accelerationEfficiency.

  • It cannot be used with consumptionInkWhPerkmAltitudeGain or recuperationInkWhPerkmAltitudeLoss.

Minimum value: 0.0
Maximum value: 1/accelerationEfficiency

uphillEfficiency float

Specifies the efficiency of converting electric energy to potential energy when the vehicle gains elevation (i.e., PotentialEnergyGained/ElectricEnergyConsumed). Notes:

  • It must be paired with downhillEfficiency.

  • It cannot be used with consumptionInkWhPerkmAltitudeGain or recuperationInkWhPerkmAltitudeLoss.

Minimum value: 0.0
Maximum value: 1/downhillEfficiency

downhillEfficiency float

Specifies the efficiency of converting potential energy to electric energy when the vehicle loses elevation (i.e, ElectricEnergyGained/PotentialEnergyLost). Notes:

  • It must be paired with uphillEfficiency.

  • It cannot be used with consumptionInkWhPerkmAltitudeGain or recuperationInkWhPerkmAltitudeLoss.

Minimum value: 0.0
Maximum value: 1/uphillEfficiency

consumptionInkWhPerkmAltitudeGain float

Specifies the electric energy in kWh consumed by the vehicle through gaining 1000 meters of elevation. Notes:

  • It must be paired with recuperationInkWhPerkmAltitudeLoss.

  • It cannot be used with accelerationEfficiency, decelerationEfficiency, uphillEfficiency or downhillEfficiency.

Minimum value: recuperationInkWhPerkmAltitudeLoss
Maximum value: 500.0

recuperationInkWhPerkmAltitudeLoss float

Specifies the electric energy in kWh gained by the vehicle through losing 1000 meters of elevation. Notes:

  • It must be paired with consumptionInkWhPerkmAltitudeGain.

  • It cannot be used with accelerationEfficiency, decelerationEfficiency, uphillEfficiency or downhillEfficiency.

Minimum value: 0.0
Maximum value: consumptionInkWhPerkmAltitudeGain

In the Electric Consumption model, explicitly specifying some parameters requires specifying some others as well. In addition, some parameters are mutually exclusive. These are the constraints:

  1. accelerationEfficiency and decelerationEfficiency must always be specified as a pair (i.e., both or none).
    • If accelerationEfficiency and decelerationEfficiency are specified, the product of their values must not be greater than 1 (to prevent perpetual motion).
  2. uphillEfficiency and downhillEfficiency must always be specified as a pair (i.e., both or none).
    • If uphillEfficiency and downhillEfficiency are specified, the product of their values must not be greater than 1 (to prevent perpetual motion).
  3. consumptionInkWhPerkmAltitudeGain and recuperationInkWhPerkmAltitudeLoss must always be specified as a pair (i.e., both or none).
    • If they are specified, recuperationInkWhPerkmAltitudeLoss must not be greater than consumptionInkWhPerkmAltitudeGain (to prevent perpetual motion).
  4. If accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency parameters are specified by the user, then vehicleWeight must also be specified.
  5. If accelerationEfficiency, decelerationEfficiency, uphillEfficiency, downhillEfficiency parameters are specified by the user, then consumptionInkWhPerkmAltitudeGain and recuperationInkWhPerkmAltitudeLoss cannot be specified.
  6. maxChargeInkWh and currentChargeInkWh must always be specified as a pair (i.e., both or none).

Note that if only constantSpeedConsumptionInkWhPerHundredKm is specified, no other consumption aspects are taken into account, i.e., slopes and vehicle acceleration are not considered for consumption computations.

Sensible values of consumption parameters

It is possible that a particular set of consumption parameters is rejected, even though it might fulfill all the explicit requirements specified previously. This will happen when the value of a specific parameter, or a combination of values of several parameters, is deemed to lead to unreasonable magnitudes of consumption values.

If that happens, it most likely indicates an input error, as proper care is taken to accommodate all sensible values of consumption parameters. In case a particular set of consumption parameters is rejected, the accompanying error message will contain a textual explanation of the reason(s).

Example:

Parameter

Sensible values by model

constantSpeedConsumptionInkWhPerHundredkm Colon-delimited list of ElectricConstantSpeedConsumptionPair

50,8.2:130,21.3

vehicleWeight integer

1900

currentChargeInkWh float

43

maxChargeInkWh float

85

auxiliaryPowerInkW float

1.7

accelerationEfficiency float

0.66

decelerationEfficiency float

0.91

uphillEfficiency float

0.74

downhillEfficiency float

0.73

consumptionInkWhPerkmAltitudeGain float

7.0

recuperationInkWhPerkmAltitudeLoss float

3.8

Response data

Response headers

The following data table describes HTTP response headers of particular interest to the Long Distance EV Routing service clients.

Header

Description

Access-Control-Expose-Headers

The service whitelists response headers that browsers are allowed to access. Value: Content-Length

Access-Control-Allow-Origin

The service allows cross-origin resource sharing. Value: * (wildcard)

Content-Encoding

The service supports HTTP compression, if requested by the client. Value: gzip

Content-Type

The format of the response. The service supports specifying the desired response format. See the contentType parameter. Values:

  • application/json; charset=utf-8
  • application/javascript; charset=utf-8
Cache-Control

The Cache-Control general-header field is used to specify directives that must be obeyed by all caching mechanisms along the request/response chain. It is supported by HTTP/1.1 clients. It may not be supported by HTTP/1.0 clients. Values:

  • no-cache
  • no-transform
Pragma

The Pragma general-header field is used to specify directives that might apply to any recipient along the request/response chain. It is supported by HTTP/1.0 client. Value: no-cache

Tracking-ID

This is an identifier for the request. If Tracking-ID was specified in the request headers, it contains the same value. Otherwise it may contain a generated value.

Warning

This may be sent for deprecated features.

Response codes

The following table describes HTTP response codes of particular interest to the Long Distance EV Routing service clients.

Code

Meaning & possible causes

200

OK: A route or range was calculated and the body of the response contains the data for a successful response.

400

Bad request:

  • One or more parameters were incorrectly specified.
  • Some parameters are mutually exclusive.
  • The points in the route request are not connected by the road network.

  • The points in the request are not near enough to a road.
  • A reachable range consistent with the given parameters could not be found.

403

Permission or authentication issues:

  • Forbidden
  • Not authorized
  • Account inactive
404

Not Found: The requested resource could not be found, but it may be available again in the future.

405

Method Not Allowed: The client used a HTTP method other than GET or POST.

408

Request timeout: The client took too long to transmit the request.

414

Requested uri is too long.

415

Unsupported Media Type.

429

Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key.

500

An error occurred while processing the request. Please try again later. This can also indicate that the request reached an internal computation time threshold and timed out.

502

Internal network connectivity issue.

503

Service currently unavailable.

504

Internal network connectivity issue.

596

Service not found.

Example of a successful response

A successful route response is received if the input parameters comprised of the coordinates, chargingParkId and waypointIndex are valid.

  • The routes in a successful response are listed in the order of decreasing optimality.
  • In case the request includes the supporting points supportingPoints field, the response will specify the reconstructed route before any alternative routes.
  • The response would contain all the specified waypoints in the requested order.
  • It may also contain charging stops that are automatically added based on the vehicle's consumption and charging model.
  • The most optimal charging times are chosen for all the charging stops in order to get the fastest possible route.
  • This may result in some manually added charging waypoints to have zero charging time, i.e., charge at departure = charge at arrival.

The type of charging stop is defined by the chargingStopType attribute in chargingInformationAtEndOfLeg. This attribute has the following values:

  • User_Defined for user-specified charging stops.
  • Auto_Generated for automatically-added charging stops.

In the case of invalid input parameters, route calculation fails, and no route is received.

A successful response when chargingParameters is used in the request could look like this:

Response body - JSON
1 [...],
2 "routes": [
3 {
4 [...],
5 "summary": {
6 [...],
7 "remainingChargeAtArrivalInkWh": 16.5,
8 "totalChargingTimeInSeconds": 2542
9 },
10 "legs": [
11 [...],
12 {
13 [...],
14 "summary": {
15 [...],
16 "originalWaypointIndexAtEndOfLeg": 0,
17 "remainingChargeAtArrivalInkWh": 12.5,
18 "chargingInformationAtEndOfLeg": {
19 "targetChargeInkWh" : 30.0,
20 "chargingTimeInSeconds" : 2542,
21 "chargingParkUuid" : "a4b60dff-b599-339a-0a1b-aae200153b86",
22 "chargingParkExternalId" : "4e9989d7-6586-44f6-ae76-fd6901b58777",
23 "chargingParkName" : "Charging park 1",
24 "chargingParkOperatorName": "Charging park operator name",
25 "chargingParkLocation": {
26 "coordinate" : {"latitude" : 0.6666667, "longitude" : -33.3333333},
27 "street" : "Main street",
28 "houseNumber" : "42a",
29 "city" : "New Berlin",
30 "postalCode" : "32606",
31 "countryCode" : "US"
32 },
33 "chargingConnectionInfo": {
34 "chargingVoltageInV": 900.0,
35 "chargingCurrentInA": 194.0,
36 "chargingCurrentType" : "Direct_Current",
37 "chargingPowerInkW" : 174.6,
38 "chargingPlugType" : "Combo_to_IEC_62196_Type_2_Base",
39 "plugAndChargeSupport" : "SUPPORTED"
40 },
41 "chargingParkPaymentOptions": [
42 {"method": "Direct"}
43 ],
44 "chargingStopType" : "Auto_Generated",
45 "chargingParkPowerInkW" : 175.0
46 }
47 }
48 }
49 ]
50 }
51 ]
52}

A successful response when chargingModes is used in the request could look like this:

Response body - JSON
1 [...],
2 "routes": [
3 {
4 [...],
5 "summary": {
6 [...],
7 "remainingChargeAtArrivalInkWh": 16.5,
8 "totalChargingTimeInSeconds": 2542
9 },
10 "legs": [
11 [...],
12 {
13 [...],
14 "summary": {
15 [...],
16 "originalWaypointIndexAtEndOfLeg": 0,
17 "remainingChargeAtArrivalInkWh": 12.5,
18 "chargingInformationAtEndOfLeg": {
19 "targetChargeInkWh" : 30.0,
20 "chargingTimeInSeconds" : 2542,
21 "chargingConnections" : [
22 {"facilityType" : "Charge_380_to_480V_3_Phase_at_32A", "plugType" : "NEMA_5_20"},
23 {"facilityType" : "Charge_Direct_Current_at_50kW", "plugType" : "IEC_62196_Type_2_Outlet"}
24 ],
25 "chargingParkUuid" : "a4b60dff-b599-339a-0a1b-aae200153b86",
26 "chargingParkName" : "Charging park 1",
27 "chargingParkOperatorName": "Charging park operator name",
28 "chargingParkLocation": {
29 "coordinate" : {"latitude" : 0.6666667, "longitude" : -33.3333333},
30 "street" : "Main street",
31 "houseNumber" : "42a",
32 "city" : "New Berlin",
33 "postalCode" : "32606",
34 "countryCode" : "US"
35 },
36 "chargingConnectionInfo": {
37 "chargingCurrentType" : "Direct_Current",
38 "chargingPowerInkW" : 25.0,
39 "chargingPlugType" : "IEC_62196_Type_2_Outlet"
40 },
41 "chargingParkPaymentOptions": [
42 {"method": "Direct"}
43 ],
44 "chargingStopType" : "Auto_Generated",
45 "chargingParkPowerInkW" : 50.0
46 }
47 }
48 }
49 ]
50 }
51 ]
52 }

The following changes apply to the response when chargingModes is used instead of chargingParameters in the request:

  • chargingInformationAtEndOfLeg contains chargingConnections.

  • chargingInformationAtEndOfLeg does not contain chargingParkExternalId.

  • chargingConnectionInfo does not contain chargingVoltageInV and chargingCurrentInA.

Example of an error response

If an error occurs, the response contains the description of the error. The error response would look like this:

Error response example - JSON
1 {
2 "formatVersion": "0.0.12",
3 "detailedError": {
4 "code": "<error code>",
5 "message": "Error message"
6 }
7 }
  • For those errors the HTTP status code is returned as normal (400, 500, ...) and the response content type is text/xml independent of the request content type.
  • For those errors, the content does not follow the documented format for error responses.
  • Note: This imperfection should not cause problems during normal use of the API.

Structure of a successful response

Note that some names are implicitly defined. One example is the name leg when describing legs as an array of leg objects.

JSON fieldDescription

formatVersion string

The format version.

routes array of route objects

The request may return more than one route. Each object has at least a summary field and a legs field. It may contain other fields depending on the request parameters.

routeReassessments array of objects

  • Included if reassessmentParameterSets is specified.

  • Each object in the array corresponds to the entry with the same index in reassessmentParameterSets (see the POST data parameters) and contains the results of a reassessment using the corresponding reassessmentParameterSet.

  • The objects describe particular aspects of the route as a whole. Their values may differ from those reported in the route summary.

  • If the reassessmentParameterSet contains auxiliaryPowerInkW, then the corresponding object may contain the following fields (see individual field descriptions for details):

    • batteryConsumptionInkWh
    • reachableRouteOffsets
  • The objects in this array may be extended with new fields in the future; clients should ignore fields they do not recognize.

legs array of leg objects

A description of a part of a route, comprised of an array of points.

  • Contains the summary field and may contain the points, encodedPolyline, and encodedPolylinePrecision fields.

  • Each additional waypoint provided in the request will result in an additional leg in the returned route.

points array of objects

Each object in the array is a location on the surface of the globe defined by its latitude and longitude fields. points and encodedPolyline are alternative representation formats. See the Route geometry representation formats section for further information.

encodedPolyline string

A string in the encoded polyline format representing the array of points describing a part of a route. The precision used to encode the polyline is set in the encodedPolylinePrecision field. The precision reflects the selected coordinatePrecision, i.e., the precision is 5 with default, and 7 with full. points and encodedPolyline are alternative representation formats. See the Route geometry representation formats section for further information.

encodedPolylinePrecision integer

The precision used to encode the polyline in the encodedPolyline field.

sections array of section objects

This array is available inside routeobjects.

  • Contains one or more section objects.

  • The structure of section objects is given below.

startPointIndex number

Index of the first point (offset 0) in the route this section applies to (only included for a routeRepresentation polyline).

endPointIndex number

Index of the last point (offset 0) in the route this section applies to (only included for a routeRepresentation polyline).

simpleCategory string

Type of the incident.

  • Can currently be JAM, ROAD_WORK, ROAD_CLOSURE, or OTHER.

  • See the tec field for detailed information.

effectiveSpeedInKmh number

The effective speed of the incident in km/h, averaged over its entire length.

delayInSeconds number

The delay in seconds caused by the incident.

magnitudeOfDelay number

The magnitude of delay caused by the incident. Possible values:

  • 0: unknown

  • 1: minor

  • 2: moderate

  • 3: major

  • 4: undefined, used for road closures and other indefinite delays

These values correspond to the values of the response field magnitudeOfDelay

tec object

Details of the traffic event. It uses the definitions in the TPEG2-TEC standard. It can contain the effectCode and causes fields. A selection of TPEG2-TEC causes can be found in the Terms and definitions of Safety related message sets.

effectCode number

The effect on the traffic flow. Contains a value in the tec001:EffectCode table, as defined in the TPEG2-TEC standard. Can be used to color-code traffic events according to severity.

causes array of objects

Each object in the array describes one cause of the traffic event.

  • It can contain mainCauseCode and subCauseCode fields.

  • It can be used to define iconography and descriptions.

mainCauseCode number

The main cause of the traffic event. Contains a value in the tec002:CauseCode table, as defined in the TPEG2-TEC standard. A selection of TPEG2-TEC causes can be found in the Terms and definitions of Safety related message sets.

subCauseCode number

The sub-cause of the traffic event. Contains a value in the sub cause table defined by the mainCauseCode, as defined in the TPEG2-TEC standard. A selection of TPEG2-TEC causes can be found in the Terms and definitions of Safety related message sets.

lengthInMeters number

The route or leg length in meters.

travelTimeInSeconds number

The estimated travel time in seconds.

trafficDelayInSeconds number

The delay in seconds compared to free-flow conditions according to real-time traffic information.

trafficLengthInMeters number

The portion of the route or leg, expressed in meters, that is affected by traffic events which cause the delay.

noTrafficTravelTimeInSeconds number

The estimated travel time in seconds calculated as if there are no delays on the route due to traffic conditions (e.g., congestion). Included if requested using the computeTravelTimeFor parameter.

historicTrafficTravelTimeInSeconds number

The estimated travel time in seconds calculated using time-dependent historic traffic data. Included if requested using the computeTravelTimeFor parameter.

liveTrafficIncidentsTravelTimeInSeconds number

The estimated travel time in seconds calculated using real-time speed data. Included if requested using the computeTravelTimeFor parameter.

deviationDistance number

The distance (in meters) from the origin point of the calculateLongDistanceEVRoute request to the first point where this route forks off from the reference route.

  • If the route is identical to the reference route, then this field is set to the length of the route.

  • Included in all alternative (but not reference) route summary fields.

deviationTime number

The travel time (in seconds) from the origin point of the calculateLongDistanceEVRoute request to the first point where this route forks off from the reference route.

  • If the route is identical to the reference route, then this field is set to the estimated travel time of the route.

  • Included in all alternative (but not reference) route summary fields.

deviationPoint object

The coordinates of the first point following the origin point of the calculateLongDistanceEVRoute request where this route forks off from the reference route.

  • If the route is identical to the reference route, then this field is set to the coordinates of the last point on the route.

  • Included in all alternative (but not reference) route summary fields.

batteryConsumptionInkWh number

The estimated electric energy consumption in kilowatt hours (kWh) using the Electric Consumption Model.

  • The value of batteryConsumptionInkWh includes the recuperated electric energy and can therefore be negative (which indicates gaining energy).

  • If both maxChargeInkWh and currentChargeInkWh are specified, recuperation will be capped to ensure that the battery charge level never exceeds maxChargeInkWh.

  • If neither maxChargeInkWh nor currentChargeInkWh are specified, unconstrained recuperation is assumed in the consumption calculation.

reachableRouteOffsets array of objects

This field is included if chargeMarginsInkWh is specified. It is not present in the leg summary field. Each object in the array corresponds to an entry in chargeMarginsInkWh, and describes the reachable point on the route with respect to the charge margin specified there. Effectively, the farthest the vehicle can go on the route on its current charge, without depleting the battery beyond the specified margin.

  • Objects in the array contain the following fields:

    • chargeMarginInkWh: the charge margin this reachable point is calculated for.

    • point: location of the reachable point defined as a latitude longitude pair.

    • pointIndex: largest index in the polyline of the route for which points[pointIndex] lies on or before point.

    • routeOffsetInMeters: the distance from the start of the route to the reachable point.

  • Note that:

    • If currentChargeInkWh is less than or equal to chargeMarginInkWh, routeOffsetInMeters is zero.

    • routeOffsetInMeters is at most lengthInMeters.

    • Charging stops are ignored in the computation so that e.g., live traffic is used as if driving past any charging station.

departureTime string

The estimated departure time for the route or leg. Specified as a dateTime.

arrivalTime string

The estimated arrival time for the route or leg. Specified as a dateTime.

effectiveSettings array of objects

Each object in the array represents an effective parameter or a data used when calling the Calculate Route API. Each object has fields key and value both containing a string describing the input and its value.

planningReason string

The reason for a better route proposal. Can currently be:

  • Blockage in case the reference route contains road blockages. The returned value is implementation-defined in case both reasons for a better proposal are applicable to the same route.

  • Better_Proposal in case the alternative type is better than the reference route, according to the given planning criteria (set by routeType).

  • Out_Of_Range in case any stop of the reference route is unreachable.

This field is included in the response only if the route is requested with alternativeType=betterRoute. This field is not present in the leg summary field.

progress array of progress point objects

This field is included if extendedRouteRepresentation is used.

  • It always contains entries for the first and the last point in the route.

  • For any pair of consecutive entries in the progress array, progress for pointIndex values that are not explicitly present and are enclosed by said pair, can be linearly interpolated by summing up straight line distances of the leg points.

  • The Haversine formula is precise enough to compute such distances.

A progress point object may contain the following members:

  • pointIndex: index of the point (offset 0) in the route this object applies to.

  • distanceInMeters: distance (in meters) from the start of the route to this point. This field is included if the extendedRouteRepresentation value distance is used.

  • travelTimeInSeconds: travel time (in seconds) from the start of the route to this point. This field is included if the extendedRouteRepresentation value travelTime is used.

  • batteryConsumptionInkWh: electric energy consumption (in kilowatt hours) from the start of the route to this point. This field is included if the extendedRouteRepresentation value consumption is used. See also the batteryConsumptionInkWh in summary section.

originalWaypointIndexAtEndOfLeg number

The index of the waypoint at the end of the leg that corresponds to:

  • The index of this waypoint in the list of waypoints from the routePlanningLocations base path parameter in the request (the first waypoint has an index equal to 0).

  • The index of this waypoint in the pointWaypoints field when reconstructing a route.

This field is not provided if the end of the leg corresponds to the destination or to a new charging waypoint that is not present in the request.

userDefinedPauseTimeInSeconds number

Contains the value of pauseTimeInSeconds, if it was specified for the corresponding leg. This field is not present in the route summary field.

entryPointIndexAtEndOfLeg number

Identifies the entry point that was used for the route at the end of the leg. This index corresponds to the position of this entry point in the list of entry points within the respective leg. The first entry point has an index equal to 0. This field is only present if the leg had entryPoints in the request.

roadShieldAtlasReference string

The base URL of the Road Shields service to fetch the road shield atlas and metadata resources. Currently available resources are:

  • sprite.png
  • sprite.json

We recommend to cache the sprite atlas (sprite.png) and metadata (sprite.json) as it changes infrequently and is large compared to a typical road shield description. Please refer to the Road Shield service for further information. The returned road shield references correspond to the asset names in the Road Shield service.

handsFreeDrivingSpeedInKmh number

The speed in km/h for the hands-free section.

importantRoadStretchIndex number

The integer value of importance. The index starts from 0, and a lower value means higher importance. The index is needed for two reasons:

  1. To understand which stretch is the most important (for example, if it is necessary to display a smaller number of stretches).
  2. To group different sections that belong to the same stretch (since there may be gaps in one stretch for various reasons).

streetName object

An object contains a text field with the name of a street.

roadNumbers array of objects

An array of objects of type RoadNumber. All items are sorted in descending order of display priority. The RoadNumber object contains a text field with the road number.

summary object

A summary of a route or a route leg. The summary object may be extended with new fields in the future; clients should ignore fields they do not recognize. It contains the following:

  • lengthInMeters
  • travelTimeInSeconds
  • trafficDelayInSeconds
  • trafficLengthInMeters
  • departureTime
  • arrivalTime
  • noTrafficTravelTimeInSeconds
  • historicTrafficTravelTimeInSeconds
  • liveTrafficIncidentsTravelTimeInSeconds
  • batteryConsumptionInkWh
  • deviationDistance
  • deviationTime
  • deviationPoint
  • reachableRouteOffsets
  • remainingChargeAtArrivalInkWh
  • chargingInformationAtEndOfLeg, if it is a leg summary and the leg ends at a charging stop.

  • totalChargingTimeInSeconds, if it is a route summary.

remainingChargeAtArrivalInkWh float

The estimated battery charge in kWh upon arrival at the end of the leg or the route.

chargingInformationAtEndOfLeg object

The chargingInformationAtEndOfLeg object is contained in the leg summary if and only if the leg ends at a charging stop. It contains:

  • targetChargeInkWh
  • chargingTimeInSeconds
  • chargingConnections
  • chargingParkUuid

In addition, it may contain any of the following:

  • chargingConnectionInfo
  • chargingParkLocation
  • chargingParkName
  • chargingParkOperatorName
  • chargingParkPowerInkW
  • chargingStopType
  • chargingParkPaymentOptions

targetChargeInkWh float

The charge in kWh to which the battery should be charged.

chargingTimeInSeconds integer

The estimated time in seconds spent at the charging stop, allowing for some additional time needed to use the charging facility.

chargingConnections array

A list of chargingConnections, one of which should be used at this charging stop.

chargingParkName string

The common name of this charging park.

chargingParkOperatorName string

The operator name of this charging park.
chargingParkPowerInkWfloatThe rated power in kilowatts of the charging park.

chargingParkLocation object

The chargingParkLocation object describes location details of this charging park. It may contain any of the following:

  • coordinate
  • street
  • houseNumber
  • city
  • region
  • postalCode
  • countryCode

coordinate object

Object is the coordinate of the charging station defined by its latitude and longitude fields. It may differ from the location on the road to drive to.

street string

The street name of the charging park.

houseNumber string

The house number of the charging park.

city string

The city of the charging park.

region string

The region of the charging park.

postalCode string

The postal code of the charging park.

countryCode string

The country code of the charging park in the ISO 3166-1 alpha-2 format.

chargingConnectionInfo object

The chargingConnectionInfo object describes details of the charging connection which should be used at this charging stop. Its contents may differ if the request contains chargingModes or chargingParameters.
For requests having chargingModes:
It contains:

  • chargingPlugType

In addition, it may contain any of the following:

  • chargingVoltageInV
  • chargingCurrentInA
  • chargingCurrentType
  • chargingPowerInkW

For requests having chargingParameters:
It contains:

  • chargingPlugType
  • chargingCurrentType
  • chargingPowerInkW

In addition, it may contain any of the following:

  • chargingVoltageInV
  • chargingCurrentInA
  • plugAndChargeSupport

chargingVoltageInV float

The rated voltage in volts of the charging process.

chargingCurrentInA float

The rated current in amperes of the charging process.

chargingCurrentType string

An element of the currentType codes table.

chargingPowerInkW float

The rated maximal power in kilowatts of the charging connection.

plugAndChargeSupport
string

Indicates if the selected charging connector supports Plug-and-Charge. Possible values are:

  • SUPPORTED
  • UNSUPPORTED

chargingPlugType string

The element of the plugType codes table used for the charging process.

plugAndChargeSupport string

Indicates if the selected charging connector supports Plug-and-Charge. Possible values are:

  • SUPPORTED
  • UNSUPPORTED

chargingParkPaymentOptions object

A list of one or more chargingParkPaymentOption elements.

chargingParkPaymentOption object

The chargingParkPaymentOption object describes payment options. It contains:

  • method
  • brands

method string

An element of the paymentMethod codes table.

brands array

A list of brands that is associated with this charging park. This element is not included if there are no associated brands.

brand string

A brand name associated with the charging park. The brand and a Mobility Service Provider are synonymous.

chargingStopType string

The source of the charging stop at the end of this leg.
Values:

  • Auto_Generated for automatically added charging stops.

  • User_Defined for user-specified waypoints. If a waypoint also includes charging data then it is considered as a user-chosen charging station and the most optimal charging times are chosen for all the charging stops in order to get the fastest possible route. This may result in some manually added charging waypoints to have zero charging time, i.e., charge at departure = charge at arrival.

chargingParkUuid string

The unique identifier of this charging park. This UUID can be used to check the availability of the charging park.

totalChargingTimeInSeconds integer

The estimated time spent at all charging stops in the route. The travelTimeInSeconds of the route includes the totalChargingTimeInSeconds value.

chargingConnection string

Contains one facilityType and one plugType which are compatible with the vehicle.

facilityType string

An element of the facilityType codes table.

chargingParkExternalId string

A unique string id for search purposes.

plugType string

An element of the plugType codes table.

Structure of the section object

Each section object contains additional information about parts of a route. A section object contains at least the fields startPointIndex, endPointIndex, and sectionType.

JSON fieldDescription

sectionType string

Contains the response section type.

Request section typeResponse section type
carTrainCAR_TRAIN
countryCOUNTRY
ferryFERRY
motorwayMOTORWAY
pedestrianPEDESTRIAN
tollRoadTOLL_ROAD
tollTOLL
tollVignetteTOLL_VIGNETTE
trafficTRAFFIC
travelModeTRAVEL_MODE
tunnelTUNNEL
carpoolCARPOOL
urbanURBAN
unpavedUNPAVED
lowEmissionZoneLOW_EMISSION_ZONE
roadShieldsROAD_SHIELDS
speedLimitSPEED_LIMIT
handsFreeDrivingHANDS_FREE_DRIVING
importantRoadStretchIMPORTANT_ROAD_STRETCH
  • The COUNTRY sections span between country border crossings from the departure, or to the destination.

    • The section additionally contains countryCode.

    • If the route has disjointed parts in the same country, there will be several sections with the same countryCode.

    • If no country can be assigned to a part of the route, as for example in international waters, there may be no country section for this part.

  • When requested using includeTollPaymentTypes, a TOLL section optionally contains tollPaymentTypes.

  • A TOLL_VIGNETTE section additionally contains a countryCode since toll vignettes are often specific to a country.

  • A TRAFFIC section may additionally contain any of the following: simpleCategory, effectiveSpeedInKmh, delayInSeconds, magnitudeOfDelay, tec.

  • TRAVEL_MODE sections cover the whole route. Each section's travel mode is reported in travelMode .

  • CARPOOL sections contain parts of the route that are only open to HOV (high-occupancy vehicles) at the time of traversal. Roads with at least one unrestricted lane are not part of a CARPOOL section.

  • ROAD_SHIELDS sections contain an array of roadShieldReference objects. Please refer to the structure of a road shield reference object for further information.

  • A HANDS_FREE_DRIVING section additionally contains the field: handsFreeDrivingSpeedInKmh. Note: If handsFreeDriving sections are requested, then handsFreeDrivingCapability must also be set.

  • An IMPORTANT_ROAD_STRETCH section additionally contains the importantRoadStretchIndex field, and contains streetName or roadNumbers fields (or both).

travelMode string

This field is either set to the value given to the request parameter travelMode, if this travel mode is possible, or to other which indicates that the given mode of transport is not possible in this section. This field can only be used within sections of type TRAVEL_MODE.

tollPaymentTypes array of strings

The tollPaymentTypes array appears in toll sections if includeTollPaymentTypes=all. Each element of tollPaymentTypes represents a toll payment type. This field can only be used within sections of type TOLL.
Possible toll payment types are:

  • CASH_COINS_AND_BILLS: Cash can be used including coins and bills.

  • CASH_BILLS_ONLY: Cash can be used, but bills only, e.g., 10 euros.

  • CASH_COINS_ONLY: Cash can be used, but coins only, e.g., 20 cents.

  • CASH_EXACT_CHANGE: Cash is used but the exact amount must be provided.

  • CREDIT_CARD: Credit cards are accepted.

  • DEBIT_CARD: Bank/debit cards are accepted.

  • TRAVEL_CARD: Travel cards are accepted.

  • ETC: Electronic toll collect either via camera or transponder.

  • ETC_TRANSPONDER: Electronic toll collect via transponder.

  • ETC_VIDEO_CAMERA: Electronic toll collect via camera.

  • SUBSCRIPTION: Toll collect based on subscription.

Structure of an error response

JSON fieldDescription

detailedError object

This object provides a representation of the error message. It contains a code and a message field.

JSON field

Description

code string

The (non-complete) list of error codes is:

Error code

Description
MAP_MATCHING_FAILURE

One of the input points (Origin, Destination, Waypoints) could not be matched to the map because there is no known drivable section near this point. This error code is always followed by a description of one point that was not matchable:

  • Origin (Latitude, Longitude)
  • Destination (Latitude, Longitude)
  • Waypoint N (Latitude, Longitude)
NO_ROUTE_FOUND

No valid route could be found.

NO_RANGE_FOUND

No valid reachable range could be found.

CANNOT_RESTORE_BASEROUTE

The route reconstruction using supportingPoints failed.

BAD_INPUT

Some input parameter combination was not valid.

COMPUTE_TIME_LIMIT_EXCEEDED

The request exceeded the internal compute time limit and was canceled.

message string

A human readable error message.

  • It is a freeform string which may be extended in the future, so it is recommended to only match substrings of the description.

  • The string always contains an error code.

Example of a description string:

Engine error while executing route request: MAP_MATCHING_FAILURE: Origin (54.3226, 3.11463)

Engine error while executing route request: MAP_MATCHING_FAILURE: Origin (54.3226, 3.11463)

Engine error while executing route request: MAP_MATCHING_FAILURE: Waypoint 3 (54.3226, 3.11463)

Structure of a road shield reference object

JSON field

Description

roadShieldReference object

This object describes a single road shield reference. It contains the following fields:

reference string

A unique identifier for the road shield.

shieldContent string

An optional string to be shown on the road shield.

affixes array of strings

An optional list of possible affixes that can be shown in addition to the shieldContent.

Calculating Long Distance EV Route with a charging park as the final destination

The calculateLongDistanceEVRoute endpoint accepts requests with a charging park as the destination. A charging park is specified by its unique identifier (UUID) which must be added to the POST data of the request. It's required the charging park specified by the UUID matches the destination's coordinates.

POST request body with chargingDestination

Example POST request body with chargingDestination - JSON
1{
2 [...],
3 "chargingDestination":
4 {
5 "chargingParkId": "{uuid}"
6 },
7 [...]
8}

Description of the chargingDestination parameter

ParameterDescription

chargingParkId string

A non-blank string depicting the ID of the charging park of the destination. The user can retrieve this ID from the TomTom EV Search.

Example curl command with chargingPark as the destination

Example POST curl command with chargingPark as the destination - JSON
1curl -X POST "https://api.tomtom.com/routing/1/calculateLongDistanceEVRoute/52.507,13.492:52.47582,13.36404/json?key={YOUR_API_KEY}&vehicleEngineType=electric&constantSpeedConsumptionInkWhPerHundredkm=32,10.87:77,18.01&currentChargeInkWh=20&maxChargeInkWh=40&minChargeAtDestinationInkWh=4&minChargeAtChargingStopsInkWh=4"\
2 -H 'Content-Type: application/json' -d '{
3 "chargingDestination":
4 {
5 "chargingParkId": "27cddfad-d11e-42bb-aba2-b5a850ee0db3"
6 },
7 "chargingModes": [
8 {
9 "chargingConnections": [
10 {
11 "facilityType": "Charge_380_to_480V_3_Phase_at_32A",
12 "plugType": "IEC_62196_Type_2_Outlet"
13 }
14 ],
15 "chargingCurve": [
16 {
17 "chargeInkWh": 6,
18 "timeToChargeInSeconds": 360
19 },
20 {
21 "chargeInkWh": 12,
22 "timeToChargeInSeconds": 720
23 },
24 {
25 "chargeInkWh": 28,
26 "timeToChargeInSeconds": 1944
27 },
28 {
29 "chargeInkWh": 40,
30 "timeToChargeInSeconds": 4680
31 }
32 ]
33 },
34 {
35 "chargingConnections": [
36 {
37 "facilityType": "Charge_200_to_240V_1_Phase_at_10A",
38 "plugType": "Standard_Household_Country_Specific"
39 }
40 ],
41 "chargingCurve": [
42 {
43 "chargeInkWh": 6,
44 "timeToChargeInSeconds": 15624
45 },
46 {
47 "chargeInkWh": 12,
48 "timeToChargeInSeconds": 32652
49 },
50 {
51 "chargeInkWh": 28,
52 "timeToChargeInSeconds": 76248
53 },
54 {
55 "chargeInkWh": 40,
56 "timeToChargeInSeconds": 109080
57 }
58 ]
59 }
60 ]
61}'

Long Distance EV Routing response

A successful route response is received if the input parameter chargingParkId is valid. The response would contain the data field chargingInformationAtEndOfLeg with charging information of the specified charging park in the summary of the last leg. The charging information would contain targetChargeInkWh calculated as max(maxChargeInkWh * 0.8, remainingChargeAtArrivalInkWh), and chargingTimeInSeconds set either to 0 or to the respective charging time if targetChargeInkWh is greater than remainingChargeAtArrivalInkWh. chargingTimeInSeconds in the summary of the last leg is not included into the route's nor the leg's travel time travelTimeInSeconds, and is provided as reference information for the driver.

In the case of an invalid input parameter chargingParkId, the chargingParkId is ignored, and the destination is considered as a destination without a charging park. The destination's coordinates are used as a final destination.

Route geometry representation formats

Certain request and response fields that describe route geometry as a polyline support two alternative representation formats:

  • An array of points defined as raw decimal coordinates, such as the supportingPoints field in requests and the points field in responses.
  • An encoded polyline string, such as the encodedPolyline field in both requests and responses.

Where documented, either of the two representations can be used. This is purely a matter of representation and is independent of any other statements about route geometry. The field containing the array of points is used as a stand-in for the concern of route geometry. For brevity, any references and constraints related to the polyline are stated using the stand-in only.

Using encoded polylines can significantly reduce the data size of requests and responses.

Encoded polyline format

For efficient representation of polylines as encoded polyline strings, this service uses an extended version of the Encoded Polyline Algorithm Format. The original algorithm limits coordinate precision to 5 decimal places by using a multiplier of 1e5 for the decimal values. The extension allows using multipliers of both 1e5 and 1e7. These multipliers correspond to precisions of 5 and 7 decimal places. Please note that each field in the encoded polyline format may have limitations on its supported precisions. Since the encoded polyline string doesn't contain information of the precision or multiplier used, this information must be provided separately alongside each encoded polyline string. We recommend taking special care when using the higher precision, as some encoding implementations may suffer internal overflows with the higher multiplier.

Encoding

When encoding a polyline, select a supported precision and use the respective multiplier for the decimal value instead of the fixed 1e5 multiplier in the original algorithm (refer to the following table). Otherwise, the encoding process remains the same as in the original algorithm. Ensure to send the precision used alongside each encoded polyline string in the request.

Decoding

When decoding a received polyline, use the provided precision next to the encoded polyline string to determine the appropriate multiplier for the decimal value instead of the fixed 1e5 multiplier in the original algorithm (refer to the following table). Otherwise, the decoding process remains the same as in the original algorithm. Note that each encoded polyline string is accompanied by the precision used for its encoding.

Precisions and multipliers

The following table illustrates the relationship between precision and multiplier:

Precision

Multiplier

51e5
71e7