Routing API v7 Developer's Guide

Consumption models

The Routing API v7 allows you to specify vehicle specific parameters, which are then used to calculate fuel or energy consumption for a car on a given route. The interface is generic to allow support for multiple different models. The Routing API v7 currently supports the standard model.

Standard consumption model

To specify the standard model, add consumptionmodel=standard to a request. You must provide additional information in the query parameter customConsumptionDetails. The unit of energy for this model is not defined and can be determined by the user. This documentation uses reference meter as a unit of energy. The term reference meter refers to the amount of energy needed to traverse 1 meter on a straight road at optimal speed. The following table shows all the possible parameters that can be sent to the standard consumption model.
Element Description
speed

Mandatory parameter

Speed dependent consumption multiplier. This parameter indicates how many units of energy are consumed by travelling 1 meter at a given speed. The value is a comma separated sequence of pairs in the form speed,consumption. A consumption function is linearly interpolated from this table.

Speed is in kilometers per hour. The speed must be an integer in the following interval: [0,255].

Consumption is a positive double value.

ascent

Mandatory parameter

Height dependent multiplier. This parameter indicates how many units of energy are consumed by increasing the altitude by 1 meter. Value must be non negative.

descent

Mandatory parameter

Height dependent multiplier. This parameter indicates how many units of energy are gained by decreasing the altitude by 1 meter. Value must be non negative.

timePenalty

Optional parameter

Energy is consumed also when turning or waiting at junctions. This parameter indicates how many units of energy are consumed by waiting 1 second. Value must be non negative.

auxiliaryConsumption

Optional parameter

Additional energy such as for air conditioning, a radio, or other features can also be consumed when driving. This parameter indicates the units of additional energy consumed per second. Value must be non-negative.

acceleration

Optional parameter

Additional energy consumed for acceleration. This parameter indicates the units of additional energy consumed per 1 (km/h)^2 of speed change. Value must be non-negative.

deceleration

Optional parameter

Additional energy gained from deceleration. This parameter indicates the units of additional energy gained per 1 (km/h)^2 of speed change. Value must be non-negative.

You must send all the parameters in one string, separated by semicolons. The example below illustrates a set of correct consumption model parameters for the standard model:
customconsumptiondetails=
speed,0,1.7,10,1.4,30,1.1,50,1.0,70,1.1,100,1.2,120,1.4,140,1.8;
ascent,30.0;descent,10.0;auxiliaryconsumption,0.8;acceleration,0.2;deceleration,0.3