Calculate Reachable Range
Purpose
The Calculate Reachable Range service calculates the geographic area that can be reached from the origin point.
- It optimizes routes with a given route type (for example, fastest, eco).
- It limits the range based on the given budget and consumption parameters.
The information returned is:
- A polygon boundary in counterclockwise orientation.
- The precise polygon center (the result of map-matching the origin point).
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
Request data
HTTPS method: GET POST
Constants and parameters enclosed in curly brackets { } must be replaced with their values.
Generic request format
The following request URL contains all of this endpoint’s parameters. For required and optional parameters, see the following sections:
https://{baseURL}/routing/{versionNumber}/calculateReachableRange/{origin}/{contentType}?key={Your_API_Key}&callback={callback}&fuelBudgetInLiters={float}&energyBudgetInkWh={float}&timeBudgetInSec={float}&distanceBudgetInMeters={float}&report={effectiveSettings}&departAt={time}&routeType={routeType}&traffic={boolean}&avoid={avoidType}&maxFerryLengthInMeters={float}&smoothing={smoothingLevel}&travelMode={travelMode}&hilliness={hilliness}&windingness={windingness}&vehicleMaxSpeed={vehicleMaxSpeed}&vehicleWeight={vehicleWeight}&vehicleAxleWeight={vehicleAxleWeight}&vehicleNumberOfAxles={vehicleNumberOfAxles}&vehicleLength={vehicleLength}&vehicleWidth={vehicleWidth}&vehicleHeight={vehicleHeight}&vehicleCommercial={boolean}&vehicleLoadType={vehicleLoadType}&vehicleAdrTunnelRestrictionCode={vehicleAdrTunnelRestrictionCode}&vehicleEngineType={vehicleEngineType}&constantSpeedConsumptionInLitersPerHundredkm={CombustionConstantSpeedConsumptionPairs}¤tFuelInLiters={float}&auxiliaryPowerInLitersPerHour={float}&fuelEnergyDensityInMJoulesPerLiter={float}&accelerationEfficiency={float}&decelerationEfficiency={float}&uphillEfficiency={float}&downhillEfficiency={float}&consumptionInkWhPerkmAltitudeGain={float}&recuperationInkWhPerkmAltitudeLoss={float}&constantSpeedConsumptionInkWhPerHundredkm={ElectricConstantSpeedConsumptionPairs}¤tChargeInkWh={float}&maxChargeInkWh={float}&auxiliaryPowerInkW={float}GET URL example
Note: Linebreaks are designated by ”\”.
https://api.tomtom.com/routing/1/calculateReachableRange/52.50931,13.42936/json?\fuelBudgetInLiters=50&report=effectiveSettings\&routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120\&vehicleCommercial=false&vehicleEngineType=combustion\&constantSpeedConsumptionInLitersPerHundredkm=50%2C8.2%3A130%2C21.3&key={Your_API_Key}GET curl command example
Note: Linebreaks are designated by ”\”.
curl -X GET "https://api.tomtom.com/routing/1/calculateReachableRange/52.50931,13.42936/json?\energyBudgetInkWh=50&report=effectiveSettings\&routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120\&vehicleCommercial=false&vehicleEngineType=electric\&constantSpeedConsumptionInkWhPerHundredkm=50%2C8.2%3A130%2C21.3\&key={Your_API_Key}" -H "accept: */*"POST URL example
Note: Linebreaks are designated by ”\”.
https://api.tomtom.com/routing/1/calculateReachableRange/52.50931,13.42936/json?\energyBudgetInkWh=50&report=effectiveSettings\&routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120\&vehicleCommercial=false&vehicleEngineType=electric\&constantSpeedConsumptionInkWhPerHundredkm=50%2C8.2%3A130%2C21.3\&key={Your_API_Key}POST curl command examples
Note: Linebreaks are designated by ”\”.
curl -X POST "https://api.tomtom.com/routing/1/calculateReachableRange/52.50931,13.42936/json?energyBudgetInkWh=43&report=effectiveSettings&routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120&vehicleCommercial=false&vehicleEngineType=electric&constantSpeedConsumptionInkWhPerHundredkm=50%2C8.2%3A130%2C21.3&key={Your_API_Key}"\ -H "accept: */*" -H "Content-Type: application/json" -d\'{ "supportingPoints": [ { "latitude": 52.50931, "longitude": 13.42936 }, { "latitude": 52.50872, "longitude": 13.42900 }, { "latitude": 52.50844, "longitude": 13.42859 } ], "avoidVignette":[ "AUS","CHE" ], "avoidAreas":{ "rectangles":[ { "southWestCorner":{ "latitude":48.81851,"longitude":2.26593 }, "northEastCorner":{ "latitude":48.90309,"longitude":2.41115 } } ] }}'curl -X POST "https://api.tomtom.com/routing/1/calculateReachableRange/52.50931,13.42936/json?energyBudgetInkWh=43&report=effectiveSettings&routeType=eco&traffic=true&avoid=unpavedRoads&travelMode=car&vehicleMaxSpeed=120&vehicleCommercial=false&vehicleEngineType=electric&constantSpeedConsumptionInkWhPerHundredkm=50%2C8.2%3A130%2C21.3&key={Your_API_Key}"\ -H "accept: */*" -H "Content-Type: application/json" -d\'{ "encodedPolyline": "evn_Io|}pAtBfAv@pA", "encodedPolylinePrecision": 5, "avoidVignette":[ "AUS","CHE" ], "avoidAreas":{ "rectangles":[ { "southWestCorner":{ "latitude":48.81851,"longitude":2.26593 }, "northEastCorner":{ "latitude":48.90309,"longitude":2.41115 } } ] }}'Types
The following data table describes the types that can be used in the Calculate Reachable Range service.
Type | Description |
|---|---|
| A latitude–longitude pair (in EPSG:4326 projection) with the following constraints:
Example: |
| A |
| A date and time specified in RFC 3339 format with an optional time zone offset.
|
| A comma-separated |
| A comma-separated |
Avoid parameter possible values
Value | Description |
|---|---|
tollRoads | Avoids toll roads. |
motorways | Avoids motorways. Note: Avoiding motorways for long routes of approximately 500km+ may result in computation timeouts of the primary route or path alternatives. |
ferries | Avoids ferries. |
unpavedRoads | Avoids unpaved roads. |
carpools | Avoids routes that require use of carpool (HOV/High Occupancy Vehicle) lanes. |
borderCrossings | Avoids crossing country borders. |
tunnels | Avoids tunnels. |
carTrains | Avoids car trains. |
lowEmissionZones | Avoids low-emission zones. |
Request headers
The following table describes the supported HTTP request headers.
- Required headers must be used; otherwise, the call will fail.
- Optional headers can be used to customize the request.
- The order of request headers is not important.
Optional headers | Description |
|---|---|
| Accept-Encoding | Requests that the response be compressed. |
| Content-Encoding | Specifies the compression used for the request body. Currently, only
Note: This header is optional and can only be used for
Values:
|
| Content-Type | Specifies the MIME type of the body of the request. Note: This header is required for Value: |
| Tracking-ID | Specifies an identifier for the request.
|
Base path parameters
The following table describes the base path parameters that can be used in the Calculate Reachable Range service.
- Required parameters must be used or the call will fail.
- The order of the required parameters is important and must be followed.
Required parameters (base path) | Description |
|---|---|
baseURLstring | The base URL used to call the API. Values:
|
versionNumberinteger | The service version number. Value: The current value is |
originlocation | Location from which the range calculation should start, in the form of a
|
contentTypestring | The content type of the response structure. Possible values:
Note: If the content type is |
Request parameters
The following table describes the parameters that can be used in the Calculate Reachable Range service.
- Required parameters must be used, or the call will fail.
- Optional parameters may be omitted, except under the specified conditions.
- The order of request parameters is not important.
- Exactly one budget (
fuelBudgetInLiters,energyBudgetInkWh,timeBudgetInSec, ordistanceBudgetInMeters) must be used. - When
fuelBudgetInLitersorenergyBudgetInkWhis used, it is mandatory to specify a detailed Consumption Model.
Required parameters | Description |
|---|---|
| The API key used to authorize requests to the API. |
Optional parameters | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fuelBudgetInLitersfloat | Fuel budget in liters that determines the maximum range that can be traveled using the specified Combustion Consumption Model. Minimum value: 0Maximum value:
| ||||||||||||||||||||
energyBudgetInkWhfloat | Electric energy budget in kilowatt-hours (kWh) that determines the maximum range that can be traveled using the specified Electric Consumption Model. Minimum value: 0Maximum value:
| ||||||||||||||||||||
timeBudgetInSecfloat | The time budget in seconds that determines the maximal range which can
be traveled. The Consumption Model will only affect the range when
Maximum value: 10000000 | ||||||||||||||||||||
distanceBudgetInMetersfloat | The distance budget in meters that determines the maximal range which
can be traveled. The Consumption Model will only affect the range when
Maximum value: 50000000 | ||||||||||||||||||||
maxFerryLengthInMetersfloat | The limit (in meters) for a single ferry connection to be included in the range calculation. The entire length of a ferry connection must be shorter than this
distance for any part of the connection to be considered for the
calculation. The value is exclusive: ferry connections greater than or
equal to this distance are ignored. Setting
Minimum value: 0Maximum value: 20000Default value: 20000 | ||||||||||||||||||||
smoothingstring | Applies a post processing step that smooths the reachable-range polygon boundary to improve its visual appearance. Stronger smoothing generally results in more points. Possible values are:
Default value: none | ||||||||||||||||||||
callbackstring | Specifies the Default value: callback | ||||||||||||||||||||
reportstring | Specifies which data to report for diagnostic purposes.
Possible value is:
effectiveSettings | ||||||||||||||||||||
departAtstring | The date and time of departure from the origin point.
nowOther value: dateTime | ||||||||||||||||||||
routeTypestring | Specifies the type of optimization used when calculating routes. (In the
case of Calculate Reachable Range, this refers to the routes on which
the reachable-range calculation is based. The range will indicate the
geographic area that can be reached on routes optimized according to
this Possible values:
fastest | ||||||||||||||||||||
coordinatePrecisionstring | Specifies the precision of coordinates in the response. Possible values:
default | ||||||||||||||||||||
reconstructionModestring | Specifies how to reconstruct a route provided with the request. The reconstructed route is used internally to keep the reachable-range polygon consistent with a specific route — see the POST data parameters section. Note: This parameter can only be used when a route is provided as part of the request by using a polyline representation format (see the Route geometry representation formats section). Possible values:
Note: In any of the modes, the algorithm might relax certain restrictions near the origin to offer a more sensible route instead of a no-route-found. This ensures that routes planned with our service can be reconstructed. In short, this table summarizes the differences between the modes and restrictions:
normal | ||||||||||||||||||||
trafficboolean | Possible values are:
Depending on availability, the service takes road closures and road works into account up to 60 days in the future. Default value: true | ||||||||||||||||||||
avoidstring | Specifies something that the route calculation should try to avoid when
determining the route. The Possible values are listed under Avoid parameter possible values. Note: In | ||||||||||||||||||||
travelModestring | The mode of travel for the requested route.
Note that travel modes
carOther values:
| ||||||||||||||||||||
hillinessstring | Degree of hilliness for a thrilling route. Note: This parameter can only be used in conjunction with
Default value: normalOther values:
| ||||||||||||||||||||
windingnessstring | Level of turns for a Note: This parameter can only be used in conjunction with
Default value: normalOther values:
| ||||||||||||||||||||
vehicleMaxSpeedinteger | Maximum speed of the vehicle in kilometers/hour.
0 | ||||||||||||||||||||
vehicleWeightinteger | Weight of the vehicle in kilograms.
0 | ||||||||||||||||||||
vehicleAxleWeightinteger | Weight per axle of the vehicle in kilograms. A value of
Default value: 0 | ||||||||||||||||||||
vehicleNumberOfAxlesinteger | Number of axles of the vehicle. A value of Default value: 0 | ||||||||||||||||||||
vehicleLengthfloat | Length of the vehicle in meters, including the length of any additional
equipment, e.g., trailers, bike racks, etc. A value of Default value: 0 | ||||||||||||||||||||
vehicleWidthfloat | Width of the vehicle in meters. A value of Default value: 0 | ||||||||||||||||||||
vehicleHeightfloat | Height of the vehicle in meters. A value of Default value: 0 | ||||||||||||||||||||
vehicleCommercialboolean | Vehicle is used for commercial purposes and thus may not be allowed to drive on some roads. Default value: false | ||||||||||||||||||||
vehicleLoadTypestring | Specifies types of cargo that may be classified as hazardous materials
and are restricted from some roads. The or ). Available values are:
Use these values for routing in the USA:
Use these values for routing in all other countries:
Notes:
| ||||||||||||||||||||
vehicleAdrTunnelRestrictionCodestring | If
Notes:
Values (specify at most one):
Reference: | ||||||||||||||||||||
vehicleHasElectricTollCollectionTransponderstring | Specifies whether the route calculation should try to avoid ETC-transponder-only toll roads if the vehicle does not have an ETC transponder. Possible values are:
all |
Consumption model parameters
The service provides a set of parameters for describing a vehicle-specific Consumption model in detail. These parameters must be specified in a calculateReachableRange request.
Depending on the value of vehicleEngineType, two principal Consumption models are supported:
- Combustion consumption model
- Electric consumption model
Note:
- Specifying parameters that belong to different models in the same request is an error.
- A Consumption model cannot be used with the
travelModevalues ofbicycleandpedestrian.
In both Consumption models, explicitly specifying some parameters requires specifying some others as well. In addition, some parameters are mutually exclusive. These are the constraints:
- All parameters require
constantSpeedConsumption*to be specified by the user.- It is an error to specify any other Consumption model parameter (with the exception of
vehicleWeight) ifconstantSpeedConsumption*is not specified.
- It is an error to specify any other Consumption model parameter (with the exception of
accelerationEfficiencyanddecelerationEfficiencymust always be specified as a pair (i.e., both or none).- If
accelerationEfficiencyanddecelerationEfficiencyare specified, the product of their values must not be greater than1(to prevent perpetual motion).
- If
uphillEfficiencyanddownhillEfficiencymust always be specified as a pair (i.e., both or none).- If
uphillEfficiencyanddownhillEfficiencyare specified, the product of their values must not be greater than1(to prevent perpetual motion).
- If
consumptionInkWhPerkmAltitudeGainandrecuperationInkWhPerkmAltitudeLossmust always be specified as a pair (i.e., both or none).- If they are specified,
recuperationInkWhPerkmAltitudeLossmust not be greater thanconsumptionInkWhPerkmAltitudeGain(to prevent perpetual motion).
- If they are specified,
- If
*Efficiencyparameters are specified by the user, thenvehicleWeightmust also be specified.- When
vehicleEngineTypeiscombustion,fuelEnergyDensityInMJoulesPerLitermust be specified as well.
- When
- If
*Efficiencyparameters are specified by the user, thenconsumptionInkWhPerkmAltitudeGainandrecuperationInkWhPerkmAltitudeLosscannot be specified. maxChargeInkWhandcurrentChargeInkWhmust always be specified as a pair (i.e., both or none).
Note that if only constantSpeedConsumption* is specified, no other consumption aspects are taken into account, i.e., slopes and vehicle acceleration are not considered for consumption computations.
A model is selected by specifying the corresponding constantSpeedConsumption* parameter and possibly further parameters that belong to the same model. The chosen model must match the value of the vehicleEngineType parameter.
Optional parameter | Description |
|---|---|
| The engine type of the vehicle. When a detailed Consumption model is
specified, it must be consistent with the value of
|
The Combustion consumption model
The Combustion consumption model is used when the vehicleEngineType value is set to combustion. The following data table describes all of the parameters that can be specified in a request using the Combustion 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.
Required parameters | Description |
|---|---|
| Specifies the speed-dependent component of consumption.
Consumption rates for speeds not in the list are found as follows:
The list must contain between 1 and 25 points (inclusive), and may not contain duplicate points for the same speed.
Consumption specified for the largest speed must be greater than or equal to that of the penultimate largest speed.
Minimum value: |
Optional parameters | Description |
|---|---|
| Weight of the vehicle in kilograms.
Minimum value: |
| Specifies the current supply of fuel in liters. |
| Specifies the amount of fuel consumed for sustaining auxiliary systems
of the vehicle, in liters per hour. It can be used to specify
consumption due to devices and systems such as AC systems, radio,
heating, etc. |
| Specifies the amount of chemical energy stored in one liter of fuel in megajoules (MJ).
Minimum value: |
| Note: This must be paired with
Minimum value: |
| Note: This must be paired with
Minimum value: |
| Note: This must be paired with
Minimum value: |
| Note: This must be paired with
Minimum value: |
The Electric consumption model
The Electric consumption model is used when vehicleEngineType is set to electric. The following data table describes all 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.
Required parameters | Description |
|---|---|
| Specifies the speed-dependent component of consumption.
Consumption rates for speeds not in the list are found as follows:
The list must contain between 1 and 25 points (inclusive), and may not contain duplicate points for the same speed.
Minimum value: |
| Note: This is required only if any *Efficiency parameter is set.
Minimum value: |
Optional parameters | Description |
|---|---|
| Specifies the current electric energy supply in kilowatt hours (kWh). |
| Specifies the maximum electric energy supply in kilowatt hours (kWh)
that may be stored in the vehicle’s battery. |
| 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. |
| Specifies the efficiency of converting electric energy into kinetic energy
when the vehicle accelerates (i.e.,
Minimum value: |
| Specifies the efficiency of converting kinetic energy into electric energy
when the vehicle decelerates (i.e.,
Minimum value: |
| Specifies the efficiency of converting electric energy into potential
energy when the vehicle gains elevation (i.e.,
Minimum value: |
| Specifies the efficiency of converting potential energy to electric
energy when the vehicle loses elevation (i.e,
Minimum value: |
| Specifies the amount of electric energy, in kWh, consumed by the vehicle when
gaining 1000 meters of elevation.
Minimum value: |
| Specifies the amount of electric energy, in kWh, gained by the vehicle when
losing 1000 meters of elevation.
Minimum value: |
POST data parameters
The supportingPoints and encodedPolyline fields, which represent a polyline using different route geometry formats, are used to guarantee a higher degree of consistency between the reachable range polygon and the reachable part of a particular route.
For more information on representing route geometry formats, see the Route geometry representation formats section.
The route represented by the given polyline is reconstructed internally, using the same parameters as those used for the reachable range calculation. The reachable part of the route, which could be the entire route or a beginning section, is found by determining the farthest point the vehicle can reach on the route with its current budget. The reachable part of the route is not explicitly returned, but it is used internally to ensure it is contained in the resulting reachable area.
- The first element of the given polyline must be identical to the origin point of the
calculateReachableRangerequest. - If a polyline is provided, then it is mandatory to specify
energyBudgetInkWhand a detailed Electric Consumption Model. - The route given by the polyline may contain traffic incidents of type
ROAD_CLOSURE, which are ignored for the calculation of the reachable part of the route. - If a polyline is provided and the route reconstruction fails, the request fails with
CANNOT_RESTORE_BASEROUTEin thedetailedErrorfield from the error response. - Road closures are ignored during the reconstruction of the given polyline (the reconstructed route may go through closures) but they are not ignored in the calculation of the reachable range.
The POST data should be in JSON format, see the Content-Type header. All POST data parameters are optional, but it is an error to use the HTTP POST method if no POST data parameters are provided. There is an upper limit on the total size of the POST data (currently 10 MB); exceeding it results in a response with the response code 413.
The following table describes the parameters that can be used in the Calculate Reachable Range service.
| Parameter | Description |
|---|---|
| An array of |
| 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 in the |
| This is an array of strings. Each string should be a 3-character, ISO 3166-1, alpha-3 country code.
Note: It is an error to specify both |
| This is an array of strings. Each string should be a 3-character, ISO 3166-1, alpha-3 country code.
Note: It is an error to specify both |
| Defines areas of certain shapes that should be avoided when planning routes. Supported
shapes include |
| This is an array of objects, with a maximum of ten elements. Each object
describes an axis-aligned rectangle, defined using the fields
|
| The south-west corner of a rectangle. It is an object consisting of a
|
| The north-east corner of a rectangle. It is an object consisting of a
|
Response data
Response headers
The following data table describes the HTTP response headers of particular interest to Calculate Reachable Range service clients.
Header | Description |
|---|---|
| Access-Control-Expose-Headers | The service whitelists response headers that browsers are allowed to
access. |
| Access-Control-Allow-Origin | The service allows cross-origin resource sharing. |
| Content-Encoding | The service supports HTTP compression, if requested by the client. |
| Content-Type | The format of the response. The service supports specifying the desired
response format. See the
|
| 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.
|
| 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 clients. |
| Tracking-ID | This is an identifier for the request. If |
| Warning | This may be sent for deprecated features. |
Response codes
The following table describes the HTTP response codes of particular interest to Calculate Reachable Range service clients.
Code | Meaning & possible causes |
|---|---|
200 | OK: A range was calculated and the body of the response contains the data for a successful response. |
400 | Bad request:
|
403 | Permission or authentication issues:
|
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 an HTTP method other than GET or POST. |
408 | Request timeout: The client took too long to transmit the request. |
414 | The request 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
Response body
{ "formatVersion": "0.0.1", "reachableRange": { "center": { "latitude": 50.9745, "longitude": 5.86605 }, "boundary": [ { "latitude": 50.98532, "longitude": 5.86595 }, { "latitude": 50.98148, "longitude": 5.86371 }, { "latitude": 50.98382, "longitude": 5.86248 }, { "latitude": 50.97733, "longitude": 5.86437 }, { "latitude": 50.98242, "longitude": 5.85815 }, { "latitude": 50.9818, "longitude": 5.85436 }, { "latitude": 50.97964, "longitude": 5.85511 }, { "latitude": 50.97844, "longitude": 5.84836 }, { "latitude": 50.97732, "longitude": 5.84762 }, { "latitude": 50.9743, "longitude": 5.84969 }, { "latitude": 50.97, "longitude": 5.84589 }, { "latitude": 50.9668, "longitude": 5.85043 }, { "latitude": 50.96705, "longitude": 5.85374 }, { "latitude": 50.96914, "longitude": 5.86007 }, { "latitude": 50.96284, "longitude": 5.85818 }, { "latitude": 50.9658, "longitude": 5.86256 }, { "latitude": 50.96201, "longitude": 5.86273 }, { "latitude": 50.96405, "longitude": 5.86589 }, { "latitude": 50.97104, "longitude": 5.86665 }, { "latitude": 50.96513, "longitude": 5.86786 }, { "latitude": 50.96663, "longitude": 5.8692 }, { "latitude": 50.963, "longitude": 5.87398 }, { "latitude": 50.96437, "longitude": 5.87707 }, { "latitude": 50.96371, "longitude": 5.88459 }, { "latitude": 50.9671, "longitude": 5.88358 }, { "latitude": 50.97004, "longitude": 5.88901 }, { "latitude": 50.97098, "longitude": 5.89176 }, { "latitude": 50.97478, "longitude": 5.88689 }, { "latitude": 50.97874, "longitude": 5.88598 }, { "latitude": 50.98175, "longitude": 5.88432 }, { "latitude": 50.97871, "longitude": 5.873 }, { "latitude": 50.98047, "longitude": 5.87153 }, { "latitude": 50.97948, "longitude": 5.86984 }, { "latitude": 50.98555, "longitude": 5.87028 }, { "latitude": 50.98632, "longitude": 5.87009 }, { "latitude": 50.98709, "longitude": 5.86749 } ] }, "report": { "effectiveSettings": [ { "key": "avoid", "value": "motorways" }, "...further settings..." ] }}Example of an error response
If an error occurs, the response contains the description of the error.
- Errors such as
MAP_MATCHING_FAILUREare returned in the same way as in acalculateRouteresponse. - If a
calculateReachableRangerequest cannot compute a polygon consistent with the input parameters, it will fail withNO_RANGE_FOUND.
Special behavior for content type jsonp
(JSON with Padding)
When the contentType=jsonp is used, the returned HTTP status code is always OK (200).
- This ensures that the
jsonpcallback will be invoked on the client side regardless of the outcome of the request. - To provide the client with the actual status of the request, a field called
statusCodeis added to the response body.
Currently, the preceding statement is not true for certain types of errors described below.
Special behavior of certain types of errors (authentication errors, request quota related errors, etc.)
- For those errors, the HTTP status code is returned as normal (
400,500, …) and the response content type istext/xml, regardless of the request content type. - For those errors, the content doesn’t 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
JSON field | Description |
|---|---|
formatVersionstring | The format version. |
statusCodenumber | The original HTTP status code, as listed in the response codes (only included
for content type |
reachableRangeobject | A polygon described using a |
centerpoint object | The center of the polygon. |
boundaryarray of point objects | The polygon boundary. Each object in the array describes a location on the boundary of the polygon. |
reportobject | A report describing the request. Contains |
effectiveSettingsarray of objects | Effective parameters or data used when calling the Calculate Reachable
Range API. Each object contains the fields |
Structure of an error response
JSON field | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
detailedErrorobject | This object provides a representation of the error message. It contains
a
|
Route geometry representation formats
Certain request fields that describe route geometry using a polyline support two alternative representation formats:
- An array of points defined as raw decimal coordinates, such as the
supportingPointsfield in requests. - An encoded polyline string, such as the
encodedPolylinefield in requests.
Where documented, either of the two representations can be used. This is purely a representational choice 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 |
|---|---|
5 | 1e5 |
7 | 1e7 |
Known Limitations
-
The polygon returned by the Calculate Reachable Range service provides an approximate representation of the area that can be reached within the specified budget, using routes matching the specified
routeTypeand other specified parameters. The characteristics of the underlying algorithm affect the representation of the reachable area. This means that the polygon cannot precisely reflect all possible area contours, inevitably resulting in differences from the actual area. -
In certain situations, the polygon may be smaller or larger than the actual reachable area.
- Portions of the reachable area may be missing from the polygon, so a route planned with the same criteria could have sections which are reachable but lie outside of the polygon.
- The polygon might include regions outside the truly reachable area.
-
Internal sanity checks are performed on the computed polygon. Due to the heuristic nature of these checks, the results may occasionally seem unexpected. For example, the check may detect that the size of the polygon is inconsistent with the request input, especially the specified budget. When this occurs, the request fails with
NO_RANGE_FOUND, which is expected behavior.