Raster Flow Tiles
Service version: 4
Last edit: 2020.12.16
On this page
Purpose
The TomTom Traffic Raster Flow Tile service serves 256 x 256 pixel or 512 x 512 pixel tiles showing traffic flow.
- All tiles use the same grid system.
- Because the traffic tiles use transparent images, they can be layered on top of map tiles to create a compound display.
- The Raster Flow tiles use colors to indicate either the speed of traffic on different road segments, or the difference between that speed and the free-flow speed on the road segment in question.
Run this endpoint
You can easily run this and other endpoints.
- Go to the TomTom API Explorer page.
- Click an endpoint.
- Click Try it out.
- Enter/select all required parameter values and any optional parameter values.
- At the bottom of the form, click Execute.
- Review the Response.
Styles description
Style details | |||||
---|---|---|---|---|---|
Name | Relation to speed | Speed intervals | Line outline colors | Line main colors | Dash colors |
absolute |
absolute |
|
|
|
No dashes |
relative |
relative to free-flow |
|
|
|
No dashes |
relative0 |
relative to free-flow |
|
|
|
|
relative0-dark |
relative to free-flow |
|
|
|
|
relative-delay |
relative to free-flow |
|
|
|
No dashes |
reduced-sensitivity |
relative to free-flow |
|
|
|
No dashes |
Style examples
Example of relative0
style
Example of relative0-dark
style
Request data
HTTPS method: GET
URL format
For ease of viewing and identification:
- Required constants and parameters are shown in bold text.
- Optional parameters are shown in plain text.
http(s)://baseURL/traffic/map/versionNumber/tile/flow/style/zoom/x/y.mimeType?key=Your_API_Key&thickness=thickness
Example
https://api.tomtom.com/traffic/map/4/tile/flow/absolute/12/2044/1360.png?key=Your_API_Key
curl command
curl 'http(s)://baseURL/traffic/map/versionNumber/tile/flow/style/zoom/x/y.mimeType?key=Your_API_Key&thickness=thickness'
Request parameters
The following table describes all of the parameters that can be used in a request.
- Required parameters must be used or the call will fail.
- Parameters and values are case-sensitive.
- Optional parameters may be used.
- If an optional parameter is not specified, where applicable, the default value listed in the table below will be used.
Required parameters | |
---|---|
Parameter | Description |
baseURL string |
Base URL for calling TomTom services. Value: api.tomtom.com |
versionNumber string |
Version of the service to call. Value: The current value is 4 . |
style string |
The style to be used to render the tile.
|
zoom integer |
Zoom level of the tile to be rendered. Value: 0..22 |
x integer |
x coordinate of the tile on the zoom grid. Value: 0..2 zoom -1 |
y integer |
y coordinate of tile on zoom grid. Value: 0..2 zoom -1 |
mimeType string |
The mime type for the Response. Value: png |
apiKey string |
API Key valid for requested service. Value: Your valid API Key. |
Optional parameters | |
Parameter | Description |
[thickness] integer |
The segment width multiplier. This parameter can only be used with the following styles:
1..20 Default value: 10 |
[tileSize] integer |
The tile size dimension in pixels. Value:
256
|
Note that the flow layer can create a patchwork tile effect if the flow traffic data changes between calls of adjacent tiles.
HTTP request headers
The following table lists HTTP request headers of particular interest to clients of the Raster Flow Tiles API endpoint.
Required headers | |
---|---|
Note: There are no required headers in this endpoint. | |
Optional headers | |
Parameter | Description |
Tracking-ID |
Specifies an identifier for the Request.
|
Accept |
Advertises which content types, expressed as MIME types, the client is able to understand. In this service, the header is used to specify a preferred Bad Request Response format. Format:
type/subtype is one of:
|
Response data
Successful response
The Raster Flow Tiles API endpoint for a valid single request returns a response in PNG format. See: style examples for more.
Error response
The Raster Flow Tiles API endpoint, for an invalid single request, returns a response body in XML or JSON format.
- By default the Error response is returned in XML format.
- In order to obtain an Error response in JSON format, the
Accept
request header with a proper value must be used. - The types of the fields refer to a JSON response.
Error response field structure
Field | Description |
---|---|
detailedError object |
Main object of the error response. |
code string |
One of a server-defined set of error codes. |
message string |
A human-readable description of the error code. |
Error response XML example
<errorResponse errorCode="400" description="z out of range 0 <= z <= 22" version="traffic-rasterizer 2.0.009">
<detailedError>
<code>INVALID_REQUEST</code>
<message>z out of range 0 <= z <= 22</message>
</detailedError>
</errorResponse>
Error response JSON example
{
"detailedError" : {
"code" : "INVALID_REQUEST",
"message" : "z out of range 0 <= z <= 22"
}
}
HTTP response codes
Code | Meaning and possible causes |
---|---|
200 |
OK |
400 |
Bad request
|
403 |
Forbidden: The supplied API Key is not valid for this request. |
405 |
Method Not Allowed: The provided HTTP Request method is known by the server, but is not supported by the target resource. |
429 |
Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key. |
500 |
Internal Server Error. |
503 |
Service currently unavailable. |
596 |
Service Not Found: Unknown version of the service. |
HTTP response headers
The following table lists HTTP response headers of particular interest to clients of the Raster Flow Tiles API endpoint.
Header | Description |
---|---|
Access-Control-Allow-Origin |
Indicates that cross-origin resource sharing (CORS) is allowed. Value: * |
Allow |
Lists the set of supported HTTP methods. The header is sent in case a 405 HTTP Response Code is returned.Value: GET, HEAD |
Cache-Control |
Contains directives for a caching mechanism. Value: private , no-cache , no-store , max-age=0 , must-revalidate |
Content-Length |
Contains information about the size of the Response body. Value: <decimal number> |
Content-Type |
Indicates the media type of the resource returned. Value:
|
Date |
Contains the date and time at which the message was originated. Value: <http-date> |
Tracking-ID |
An identifier for the Request.
<string> |