Search for content

Traffic Patterns

Traffic patterns represent the traffic flow based on historical and statistical data. The data contains speeds for each week day in a 15 minute time span grid.

API endpoint

You need the following API endpoint to request traffic patterns:

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. If no reference time is given, the service will use the current UTC time as reference time. 

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=trafficPatterns&referenceTime=2024-03-11T10:41:34Z&apiKey=YOUR_API_KEY

Get your free API Access Key

Response

The call result is a single map tile in MapBox Vector Tiles format.

Tile content

The requested vector tile contains data which is listed in this table. The individual columns are explained below.

Name of contentType
geometrySRID 3857 
speedinteger
display_categoryinteger
directionboolean
driving_sidestring

Speed

Defines the relative speed on a road segment for a driving direction. It is a value between 0 and 100, the calculation formula is current speed / free flow speed * 100.

Display category

Defines the importance of a road segment that contains a traffic pattern. Road segments with a high priority are displayed earlier than road segments with a lower priority.

Display categoryMeaning
1The most important road segments like motorways and two-lane federal highways
2Road segments of medium importance like single-lane federal highways or land roads.
3All other road segments.

 

Direction

Defines the direction of the traffic pattern relative to road segment drawing direction.

DirectionMeaning
falseTraffic pattern in drawing direction of the road segment
trueTraffic pattern against drawing direction of the road segment

 

Driving side

Defines if the road segment has left- or right-hand traffic.

Driving SideMeaning
LLeft-hand traffic 
RRight-hand traffic

Styling

Traffic patterns are shown as lines in green, orange and red, symbolizing the average driving speed in relation to the free flow driving speed.

Layer names

Our predefined layer styles have a recurring naming scheme. All traffic pattern layers start with TSP_TrafficPatterns_.

Layer nameDescription
TSP_TrafficPatterns_Against_Direction_MajorDefines the style for patterns against the drawing direction of the segment on major priority roads.
TSP_TrafficPatterns_In_Direction_MajorDefines the style for patterns in drawing direction of the segment on major priority roads.
TSP_TrafficPatterns_Against_Direction_MediumDefines the style for patterns against the drawing direction of the segment on medium priority roads.
TSP_TrafficPatterns_In_Direction_MediumDefines the style for patterns in drawing direction of the segment on medium priority roads.
TSP_TrafficPatterns_Against_Direction_MinorDefines the style for patterns against the drawing direction of the segment on minor priority roads.
TSP_TrafficPatterns_In_Direction_MinorDefines the style for patterns in drawing direction of the segment on minor priority roads.

 

How to implement

Tutorial on how to integrate traffic patterns into a Vector Map: https://developer.myptv.com/en/resources/tutorials/map-rendering/vector-map-overlays-react-app