Raster Incident Tiles
Purpose
The TomTom Traffic Tile service serves 256 x 256 pixel or 512 x 512 pixel tiles showing traffic incidents. 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. Traffic tiles render graphics to indicate traffic on the roads in the specified area. The Traffic incidents tiles use colors to indicate the magnitude of delay
associated with the particular incident on a road segment. The magnitude of delay
is determined based on the severity of traffic congestion associated with the particular incident.
Run this endpoint
You can easily run this and other endpoints. Go to the TomTom API Explorer page and follow the directions.
Styles description
Style details
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
---|---|---|---|---|---|---|---|
|
| No glow |
|
|
|
|
|
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
|
| No glow |
|
|
|
|
|
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
|
| No glow |
|
|
| No POIs | No POIs |
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
|
|
|
|
| No dashes | No POIs | No POIs |
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
|
|
|
|
| No dashes | No POIs | No POIs |
Name | Magnitude values | Line glow colors | Line outline colors | Line main colors | Dash colors | POI stroke colors | POI main colors |
|
|
|
|
| No dashes | No POIs | No POIs |
Style examples
Example of s0
style
Example of s0-dark
style
Request data
HTTPS method: GET
- Constants and parameters enclosed in curly brackets { } must be replaced with their values.
- 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 format
https://{baseURL}/traffic/map/{versionNumber}/tile/incidents/{style}/{zoom}/{x}/{y}.{format}?key={Your_API_Key}&t={t}
Example
https://api.tomtom.com/traffic/map/4/tile/incidents/s3/12/2044/1360.png?key={Your_API_Key}
curl command format
curl 'https://api.tomtom.com/traffic/map/4/tile/incidents/s3/12/2044/1360.png?key={Your_API_Key}'
Request parameters
The following table describes 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.
Required parameters | Description |
---|---|
| The base URL for calling TomTom services.
|
| The version of the service to call. |
| The style to be used to render the tile.
Values:
|
| The zoom level of the tile to be rendered. |
| The |
| The |
| An API Key valid for the requested service. |
| The format of the response.
|
Optional parameters | Description |
---|---|
| The
Traffic Model ID
is the reference value for the state of traffic at a particular time.
Use |
| The tile size dimension in pixels. |
Request headers
The following table lists HTTP response headers of particular interest to clients of the Traffic Incident Raster Tiles API endpoint. Note: There are no required headers in this endpoint.
Optional headers | Description |
---|---|
Tracking-ID | Specifies an identifier for the request. It can be used to trace a call.
The value must match the regular expression
|
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.
Value
Examples:
|
Response data
Successful response
The Raster Incident Tiles API endpoint for a valid single request returns a response in PNG format. See: style examples for more information.
Error response
The Raster Incident 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 the 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 |
---|---|
| Main object of the error response. |
| One of a server-defined set of error codes. |
| A human-readable description of the error code. |
1<errorResponse errorCode="400" description="z out of range 0 <= z <= 22" version="traffic-rasterizer 2.0.009">2 <detailedError>3 <code>INVALID_REQUEST</code>4 <message>z out of range 0 <= z <= 22</message>5 </detailedError>6</errorResponse>
1{2 "detailedError": {3 "code": "INVALID_REQUEST",4 "message": "z out of range 0 <= z <= 22"5 }6}
Response codes
Code | Meaning & possible causes |
---|---|
| OK |
| Bad request, usually due to a malformed syntax.
|
| Forbidden: The supplied API Key is not valid for this request. |
| Method Not Allowed: The provided HTTP request method is known by the server, but is not supported by the target resource. |
| Too Many Requests: Too many requests were sent in a given amount of time for the supplied API Key. |
| Internal Server Error |
| Service currently unavailable |
| Service Not Found: Unknown version of the service |
Response headers
The following table lists HTTP response headers of particular interest to clients of the Traffic Incident Raster Tiles API endpoint.
Header | Description |
---|---|
Indicates that cross-origin resource sharing (CORS) is allowed. | |
Lists the set of supported HTTP methods. The header is sent in case a
| |
Contains directives for a caching mechanism. | |
Contains information about the size of the response body. | |
Indicates the media type of the resource returned.
In case of the | |
Contains the date and time when the message was originated. | |
Tracking-ID | An identifier for the request. If the
Tracking-ID header was specified in
the request, it is replicated in the response. Otherwise, it is
generated automatically by the service. For details check
RFC 4122. It is only meant to be used for support and does not involve tracking
of you or your users in any form.
Value: |
TrafficModelID | Contains the reference value for the state of traffic at a particular
time. If the request contains a valid Traffic Model ID and is not equal
to |