Truck restrictions symbolize either complete driving restrictions for trucks or they indicate a driving permit under restricted conditions depending on physical characteristics such as weight, length or height. Some truck restrictions are time-dependent, while others apply permanently.
API endpoint
You need the following API endpoint to request truck restrictions:
https://api.myptv.com/maps/overlays/v1/vector-tiles/
Request
For a single tile showing Paris, France specify the map tile path with zoomLevel
, x
and y
as shown below.
You can test this by entering the URL into your web browser. Be sure to replace YOUR_API_KEY
with your actual API key.
https://api.myptv.com/maps/overlays/v1/vector-tiles/11/1037/704?layers=truckRestrictions&apiKey=YOUR_API_KEY
Response
The call result is a single map tile in MapBox Vector Tiles format.
Data content
Tile content
The requested vector tile contains data which is listed in this table. The individual columns are explained below.
Name of content | Type |
geometry | SRID 3857 |
restriction_type | integer |
time_dependent | boolean |
closure_direction | integer |
restriction_type_description | text |
structured_descriptions | json format |
iso_country_code | char |
display_category | integer |
height | integer |
weight | integer |
width | integer |
length | integer |
axle_load | integer |
number_of_axles | integer |
kingpin_rear_axle_length | integer |
hazardous_material_type | integer |
Restriction types
The following table shows the different restriction types and their meaning, as well as an example description. Note that the data values are provided in units of cm
and kg
, but the description texts use m
and t
. These units were chosen on purpose to avoid floating point inconsistencies in calculations.
Icon | Meaning | Unit | Restriction type | Restriction type description | Example description available in structured_descriptions[i].description |
Multiple restrictions on the same road segment. | -1 | Combined restrictions | |||
The maximum vehicle height allowed. | cm | 1 | Height restriction | Maximum vehicle height: 3,5 m | |
The maximum vehicle weight allowed. | kg | 2 | Weight restriction | Maximum vehicle weight: 1 t | |
The maximum vehicle width allowed. | cm | 3 | Width restriction | Maximum vehicle width: 3 m | |
The maximum vehicle length allowed. | cm | 4 | Length restriction | Maximum vehicle length: 4 m | |
The maximum axle load allowed. | kg | 5 | Axle load restriction | Maximum vehicle axle load: 1 t | |
Length restriction - kingpin to rear axle | m | 7 | Length restriction (Kingpin to Rear Axle) | Maximum distance from kingpin to rear axle: 9.14 m | |
The tunnel restriction code B. | 8 | Tunnel restriction: Code B | Tunnel restriction: Code B | ||
The tunnel restriction code C. | 9 | Tunnel restriction: Code C | Tunnel restriction: Code C | ||
The tunnel restriction code D. | 10 | Tunnel restriction: Code D | Tunnel restriction: Code D | ||
The tunnel restriction code E. | 11 | Tunnel restriction: Code E | Tunnel restriction: Code E | ||
Not allowed for vehicles carrying hazardous goods. | 12 | Hazardous goods not allowed | Blocked for transports with hazardous goods | ||
Not allowed for vehicles carrying goods hazardous to water. | 13 | Goods hazardous to water not allowed | Blocked for transports with goods hazardous to water. | ||
Not allowed for vehicles carrying combustibles. | 14 | Combustibles not allowed | Blocked for transports with explosive substances. | ||
General truck restriction, independent if a truck has a trailer or not. | 15 | General access restriction | Blocked for trucks | ||
Trucks with trailer restriction. | 16 | Trucks with trailer restriction | Blocked for vehicles with trailer | ||
Length restriction for trucks with trailers. | cm | 17 | Length restriction for trucks with trailers | Maximum vehicle length (including trailer): 5 m | |
Width restriction for trucks with trailers. | cm | 18 | Width restriction for trucks with trailers | Maximum vehicle width (including trailer): 3 m | |
General truck restriction except for delivery vehicles. | 19 | General access restriction except for deliveries | Blocked for trucks - free for deliveries | ||
The maximum vehicle weight allowed with an exception for delivery vehicles. | kg | 20 | Free for deliveries | Maximum vehicle weight: 1 t - free for deliveries |
Tunnel restrictions
Defines the main tunnel restriction codes according to ADR ("European Agreement Concerning the International Carriage of Dangerous Goods by Road"). There are some more restriction codes that are a combination of the main codes where the actual restriction code depends on other parameters of the vehicle and its load. For example, the restriction code B/D is B for tank carriage and D for other carriage.
Tunnel enumeration value | Meaning |
B | Passage forbidden through tunnels of category B, C, D and E. |
C | Passage forbidden through tunnels of category C, D and E. |
D | Passage forbidden through tunnels of category D and E. |
E | Passage forbidden through tunnels of category E. |
Hazardous goods, hazardous to waters and combustibles
Truck restrictions for specific hazardous materials like hazardous to waters or combustibles are subsets of hazardous goods. That means if a road segment is restricted for hazardous goods, the segment is also restricted for transports carrying goods hazardous to waters or combustibles.
Closure direction
Closure direction is an attribute that defines the direction of the link or lane closed for vehicles with specific restrictions. The direction is symbolized with an arrow pattern in our PTV style if the closure is only valid for one direction.
Closure direction | Meaning |
0 | Not set in the data |
-1 | Only valid for restriction_type = -1 : The single restrictions have different directions |
1 | Closed in both directions |
2 | Closed in positive direction, meaning the restriction is valid in the direction in which the coordinates of the geometry are stored. |
3 | Closed in negative direction, meaning the restriction is valid in the opposite direction in which the coordinates of the geometry are stored. |
Display category
Defines the importance of a road segment on which a restriction is located. Restricted road segments with a high priority are displayed earlier than restricted road segments with a lower priority.
Display category | Meaning |
1 | The most important road segments like motorways and two-lane federal highways. |
2 | Road segments of medium importance like single-lane federal highways or land roads. |
3 | All other road segments. |
Time dependency
Some truck restrictions are time-dependent. That means they are only valid for a special time span.
The structured_descriptions
parameter is an array of JSON objects where each object has the following structure:
// typed explanation of a structured_descriptions object
{
description: string;
time_domain_descriptions: string[];
}
The description
part contains a formatted text that expresses the type and value of the restriction. The time_domain_descriptions
are only available for time-dependent restrictions and contain a list of formatted texts that describe the times or time spans when this restriction is valid.
For example:
{
description: "Maximum vehicle weight: 7.5 t",
time_domain_descriptions: [
"Valid on Sat every week from 07:00 to 20:00",
"Valid from January to June from 07:00 to 20:00",
"Valid from September to December from 07:00 to 20:00"
]
}
You can, for example, use these descriptions to show a popup in your UI when the user clicks on a truck restriction icon.
Country code
ISO country code contains a three-character country code. Examples are DEU
for Germany or FRA
for France. You can find more information about this code here: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
The PTV style contains special country-dependent icons for Canada, USA and Mexico.
Icon Default | Canada | USA | Mexico | Meaning |
Multiple restrictions on the same road segment. | ||||
The maximum vehicle height allowed. | ||||
The maximum vehicle weight allowed. | ||||
The maximum vehicle width allowed. | ||||
The maximum vehicle length allowed. | ||||
The maximum axle load allowed. | ||||
Restricted number of axles. | ||||
The tunnel restriction code B. | ||||
The tunnel restriction code C. | ||||
The tunnel restriction code D. | ||||
The tunnel restriction code E. | ||||
Not allowed for vehicles carrying hazardous goods. | ||||
Not allowed for vehicles carrying goods hazardous to water. | ||||
Not allowed for vehicles carrying combustibles. | ||||
General truck restriction, also valid for trucks with trailers. | ||||
General truck restriction valid for trucks with trailers. | ||||
Length restriction for trucks with trailers. | ||||
Width restriction for trucks with trailers. | ||||
General truck restriction except for delivery vehicles. | ||||
Weight restriction except for delivery vehicles. |
Styling
Truck restrictions are symbolized through lines and icons. If there is more than one restriction on a road segment, this is symbolized by a group icon. Lines generally define restrictions on this road segment. The icons indicate which type of restriction is valid on the road segment.
Layer names
Our predefined layer styles have a recurring naming scheme. All layers start with TSP_TruckRestrictions_HERE
or TSP_TruckRestrictions_Shield_HERE
Layer Name | Description |
TSP_TruckRestrictions_HERE_Major_Outer | Defines the outline style for restrictions on road segments with higher priority. |
TSP_TruckRestrictions_HERE_Major_Inner | Defines the line style for restrictions on road segments with higher priority. |
TSP_TruckRestrictions_HERE_Minor_Outer | Defines the outline style for restrictions on road segments with minor priority. |
TSP_TruckRestrictions_HERE_Minor_Inner | Defines the line style for restrictions on road segments with minor priority. |
TSP_TruckRestrictions_HERE_Oneway | Defines the line style for uni-directional restrictions with arrowed lines. |
TSP_TruckRestrictions_Shield_HERE | Defines the style for restriction icons (Europe). |
TSP_TruckRestrictions_Shield_HERE_USA | Defines the style for restriction icons (USA). |
TSP_TruckRestrictions_Shield_HERE_MEX | Defines the style for restriction icons (Canada). |
TSP_TruckRestrictions_Shield_HERE_CAN | Defines the style for restriction icons (Mexico). |
Each single layer definition carries information of how to render a restriction from a vector tile. The layers are rendered in the order as they are defined in your style.json.
{
"id": "TSP_TruckRestrictions_HERE_Major_Outer",
"type": "line",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 9,
"filter": [
"all",
["!=", "restriction_type", 0],
["in", "display_category", 1, 2]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-width": {"base": 5, "stops": [[12, 5], [15, 7], [18, 9]]},
"line-color": "rgba(150, 10, 10, 1)",
"line-opacity": 1
}
},
{
"id": "TSP_TruckRestrictions_HERE_Major_Inner",
"type": "line",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 9,
"filter": [
"all",
["!=", "restriction_type", 0],
["in", "display_category", 1, 2]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-width": {"base": 2, "stops": [[12, 3], [15, 5], [18, 7]]},
"line-color": "rgba(220,50, 80, 1)",
"line-opacity": 1
}
},
{
"id": "TSP_TruckRestrictions_HERE_Minor_Outer",
"type": "line",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 12,
"filter": [
"all",
["!=", "restriction_type", 0],
["in", "display_category", 3]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-width": {"base": 4, "stops": [[12, 5], [15, 7], [18, 9]]},
"line-color": "rgba(150, 10, 10, 1)",
"line-opacity": 1
}
},
{
"id": "TSP_TruckRestrictions_HERE_Minor_Inner",
"type": "line",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 12,
"filter": [
"all",
["!=", "restriction_type", 0],
["in", "display_category", 3]
],
"layout": {
"line-cap": "round",
"line-join": "round",
"visibility": "visible"
},
"paint": {
"line-width": {"base": 3, "stops": [[12, 3], [15, 5], [18, 7]]},
"line-color": "rgba(220, 50, 80, 1)",
"line-opacity": 1
}
},
{
"id": "TSP_TruckRestrictions_HERE_Oneway",
"type": "symbol",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 16,
"filter": [
"all",
["!=", "restriction_type", 0],
["in", "closure_direction", 2, 3]
],
"layout": {
"symbol-placement": "line",
"icon-rotate": [
"case",
["==", ["get", "closure_direction"], 2],
0,
["==", ["get", "closure_direction"], 3],
180,
0
],
"icon-size": 0.5,
"text-allow-overlap": true,
"icon-allow-overlap": true,
"icon-image": "restriction-arrow",
"symbol-spacing": 1
}
},
...
{
"id": "TSP_TruckRestrictions_Shield_HERE",
"type": "symbol",
"source": "ptv-content",
"source-layer": "HERE_TruckRestrictionLayer",
"minzoom": 12,
"filter": [
"all",
[ "!=", "restriction_type", 0 ],
[ "!=", "iso_country_code", "USA" ],
[ "!=", "iso_country_code", "MEX" ],
[ "!=", "iso_country_code", "CAN" ],
[ "in", "display_category", 1, 2, 3 ]
],
"layout": {
"icon-image": [
"image",
[
"concat",
"truckblock-",
[ "get", "restriction_type" ]
]
],
"symbol-placement": "line",
"symbol-spacing": 600,
"icon-size": 1,
"icon-rotation-alignment": "viewport",
"visibility": "visible"
},
"paint": {
"text-color": "rgba(0, 0, 0, 1)",
"text-opacity": 1
}
},
A layer definition generally consists of many parameters. You can find here a more detailed description about the parameters and the spritesheets in the styling documentation.
How to implement
The tutorial on how to integrate overlays into a Vector Map also addresses truck restrictions.